Dec 19, 2006 #1 O oualkadi Member level 3 Joined Oct 29, 2005 Messages 57 Helped 3 Reputation 12 Reaction score 1 Trophy points 1,288 Activity points 1,563 how to calculate DTFT of an analog signal using matlab?
Dec 20, 2006 #2 helios Full Member level 2 Joined Jun 3, 2005 Messages 146 Helped 22 Reputation 44 Reaction score 10 Trophy points 1,298 Activity points 2,798 Be clear that in MATLAB you can do only FFT which is a efficient form of DTFT. now lets take a analog signal x= A sin (2*pi*f*t); ( in a PC nothing is analog)... so lets make it Discrete ... and the sampling freq fs = ( 1/Ts) lets and fs > 2*fm .. fm = max freq in our input signal lets take Ts=0.1 for a period of 1 sec Code: Ts=0.1; T= 0:Ts:1; f=3; %hz x= 10.*sin(2*pi*f*T); plot(T,x); freq= fft(x); %takeing FFT for the signal plot(fftshift(abs(freq))); this must be a simple matlab code but i dont know if the syntax are correct hope it helped you
Be clear that in MATLAB you can do only FFT which is a efficient form of DTFT. now lets take a analog signal x= A sin (2*pi*f*t); ( in a PC nothing is analog)... so lets make it Discrete ... and the sampling freq fs = ( 1/Ts) lets and fs > 2*fm .. fm = max freq in our input signal lets take Ts=0.1 for a period of 1 sec Code: Ts=0.1; T= 0:Ts:1; f=3; %hz x= 10.*sin(2*pi*f*T); plot(T,x); freq= fft(x); %takeing FFT for the signal plot(fftshift(abs(freq))); this must be a simple matlab code but i dont know if the syntax are correct hope it helped you