dBc/Hz phase noise undefined function error?
Mostra commenti meno recenti
I am trying to use phaseNoiseMeasure (https://www.mathworks.com/help/msblks/ref/phasenoisemeasure.html) function to find dBc/Hz from the time domain data. But it gives me an error as an undefined function.
I also have the FFT data in dB with me, which also probably can be used to fine the dBc/Hz.
In general, I want to find the phase noise in dBc/Hz by any means. But I am lost in how should I get there.
Risposta accettata
Più risposte (1)
Shanzeng Guo
il 14 Mag 2021
0 voti
I also try to use phaseNoiseMeasure function to find dBc/Hz from the time domain data. But I got error messages. Here is my code for this exercise:
=========================
close all;
% Specify the parameters of a signal with a sampling frequency of 1 kHz and a signal duration of 1.5 seconds.
Fs = 20000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 4000; % Length of signal samping points
t = (0:L-1)/Fs; % Time vector
pad=zeros(100,1);
%% LFM Signal -- A signal cotians two signals: f1, f2
fc=5000; % Hz
ffm=fc+800*t; % Hz
fam=0; %10;
theta=1; % important factor for umop
phs=1;
s1 = diag((1+0.5*cos(2*pi*fam*t))'*cos(2*pi*(ffm.*t)+phs*rand()/theta));
H = hilbert(s1');
% Plot the noisy signal in the time domain. It is difficult to identify the frequency components by looking at the signal X(t).
Y = fft(H); % compute FFT
% 1. Compute the two-sided spectrum P2.
% 2. Then compute the single-sided spectrum P1 based on P2
% 3. and the even-valued signal length L.
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
P1=normalize(P1,'range');
% Define the frequency domain f and plot the single-sided amplitude spectrum P1.
% The amplitudes are not exactly at 0.7 and 1, as expected, because of the added noise.
% On average, longer signals produce better frequency approximations.
f = Fs*(0:(L/2))/L; % The max frequency that can be measured, based on Nyquist
figure;
hold on;
plot(f,P1)
title('Single-Sided Amplitude Spectrum of s1(t)-LFM1')
xlabel('f (Hz)')
ylabel('|P1(f)|')
%%
f1=f';
p1=P1';
rbw = 1e3;
FrOffset = [1e3 2e3 4e3 4e3];
PNTarget = [-56 -106 -132 -143];
PNMeasure = phaseNoiseMeasure(f1,p1,rbw,FrOffset,'on','Phase noise', PNTarget)
=====
Any help is appreciated.
Categorie
Scopri di più su Signal Attributes and Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!