How to plot the spectrum of a high frequency sine wave of above 1GHz
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Praveen kumar
am 13 Feb. 2014
Kommentiert: Praveen kumar
am 17 Feb. 2014
Please help me with the matlab code
0 Kommentare
Akzeptierte Antwort
Wayne King
am 13 Feb. 2014
Do you have the Signal Processing Toolbox:
Fs = 4e9;
t = 0:1/Fs:0.001-(1/Fs);
x = cos(2*pi*1.5e9*t);
[Pxx,F] = periodogram(x,[],length(x),Fs,'power');
plot(F,Pxx)
If you do not, you can use fft()
xdft = fft(x);
xdft = xdft(1:length(x)/2+1); % works for even length x
deltaf = Fs/length(x);
freqvec = 0:deltaf:Fs/2;
plot(freqvec,abs(xdft))
Note that latter is not scaled.
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!