How do I compute phase noise of a signal I have imported from LTSpice ?

22 visualizaciones (últimos 30 días)
Koustubh
Koustubh el 14 de Mayo de 2024
Respondida: Raghava S N el 20 de Mayo de 2024
I was simulating a ring oscillator made up of 3 cascaded inverters in LTspice, I exported the output waveform of the oscillator alongwith the time instants first into an excel file then into MATLAB. I looked up and MATLAB has a built in function called phaseNoiseMeasure which can take in signal strength and time indices and compute the phase noise vs offset freq plot for you. But when I run my code, I get the following error:
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Error in phaseNoiseMeasure (line 199)
PhaseNoiseFrPn=sortrows([FrOffset;PnTarget]');
Error in PhaseNoiseMeasurement (line 4)
PNMeasure = phaseNoiseMeasure(t,sig,rbw,'on','Phase noise','Type','Time','Histogram','on');
My code is as follows:
t = str2double(Inverter_Osc.time);
sig = str2double(Inverter_Osc.Vosc);
rbw = 10e12;
PNMeasure = phaseNoiseMeasure(t,sig,rbw,'on','Phase noise','Type','Time','Histogram','on');
where Inverter_Osc is the table with my data of size 3867x2 and t and sig are my time and signal strength vectors respectively of dimensions 3867x1 each....I have set rbw to 10e12 because in LTspice I used 0.1ps as the time step

Respuestas (1)

Raghava S N
Raghava S N el 20 de Mayo de 2024
Hi Koustubh,
I understand the issue you are facing is an error message about inconsistent array dimensions while using the “phaseNoiseMeasure” function in MATLAB. It seems the crux of the issue lies in the function's usage and the specific parameters being used for phase noise analysis.
The “phaseNoiseMeasure” function is designed to assess the single-sideband phase noise levels of signals, whether they are in the time or frequency domain, by evaluating them at predefined frequency offset points. The relevant function definitions are as below:
  1. Primary Usage: PNMeasure = phaseNoiseMeasure(Xin, Yin, RBW, FrOffset, PlotOption, tag, Name, Value)
  2. With Phase Noise Target: PNMeasure = phaseNoiseMeasure(___, PNTarget, Name, Value)
  3. Output with Generated Offsets and Noise: [PNMeasure, GenFrOffset, GenPN] = phaseNoiseMeasure(___)
Focusing on the first two definitions, which are most pertinent to this situation, the arguments- “Xin”, “Yin”, “RBW”, “FrOffset”, “PlotOption”, and “tag” are mandatory. The code in the MATLAB Answers post indicates that the “FrOffset” argument, which specifies the frequency offsets for phase noise calculation, was omitted. This parameter is essential and must be defined as a positive real vector in Hertz and passed to the function.
Moreover, if the analysis requires comparing the measured phase noise levels against a predefined target profile, the “PNTarget” argument in the function call becomes necessary. This allows for a direct comparison at the specified frequency offsets.
For a comprehensive understanding and further details on each parameter, refer to the MATLAB 2024a documentation link for “phaseNoiseMeasure” - https://www.mathworks.com/help/releases/R2023b/msblks/ref/phasenoisemeasure.html?s_tid=doc_ta.

Categorías

Más información sobre Visualize and Interpret Serial Link Project Analysis Results en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by