- Think about how fast you should sample a signal that has a frequency of 100 MHz. Your sampling interval is 0.1 seconds, or a 10 Hz sampling rate. Is that adequate?
- You have to create a proper frequency vector so you can plot the Fourier transform. If you search the MATLAB doc and this forum, there are many examples of how to do that.
- Think about the Fourier transform, is the Fourier transform of a signal real-valued or complex-valued in general? If it's complex-valued, what would the plot to look like?
Generate a signal wave - Spectrum using FFT
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Problem:
Generate a signal wave: ysignal=1+0.1*cos(2*pi*f1*t) and calculate its spectrum using fft (suppose f1=100.02 MHz)
My Solution:
%%Clear Data
clc;
clear all;
% generate a signal wave
t = 0:0.1:10;
f1 = 100.02*10^6;
y_sig = 1+01*cos(2*pi*f1*t);
plot(f1, fft(y_sig));
What steps should I rewrite?
Thank you
0 Kommentare
Antworten (2)
Wayne King
am 11 Mär. 2013
Bearbeitet: Wayne King
am 11 Mär. 2013
Since this is obviously a homework problem, I'm not going to just give you answer.
But since you included some code as an attempt, I will point out some issues:
0 Kommentare
Youssef Khmou
am 11 Mär. 2013
hi, the sample rate Fs must be at least twice the maximum frequency contained in the signal :
Generate a signal wave: ysignal=1+0.1*cos(2*pi*f1*t) and calculate its spectrum using fft (suppose f1=100.02 MHz)
Fs=220; % suppose its MHz
t=0:1/Fs:1-1/Fs;
f1=100.02; % suppose its Mhz
ysignal=1+0.1*cos(2*pi*f1*t);
figure, plot(t,ysignal);
L=length(ysignal);
N=ceil(log2(L));
F=fft(ysignal,2^N)/L/2;
f=(Fs/2^N)*(0:2^(N-1)-1);
figure, plot(f,abs(F(1:2^(N-1))));title(' FFT(ysignal)')
xlabel(' Frequency in Mhz');
figure, plot(f,10*log10(abs(F(1:2^(N-1)))));title(' FFT(ysignal), LOG')
xlabel(' Frequency in Mhz');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!