How to plot the spectrum of a high frequency sine wave of above 1GHz
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Praveen kumar
le 13 Fév 2014
Commenté : Praveen kumar
le 17 Fév 2014
Please help me with the matlab code
0 commentaires
Réponse acceptée
Wayne King
le 13 Fév 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!