Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
claudiocamera said:eg Yn=abs(fftshift(fft(y,n)))/N where N is the number of points of the signal and n >N is the number of points of the DFT ( n-N is zero padding).
zhenyabb said:in MatLab help is good example for fft,
roughly output spectrum in dB is:
20log10(abs(fft(sin(2*pi*fc*tt))))
in this case the amlitude is 2 peak-to-peak that corresponds 10 dBm(at)50 Ohm for sine signal with amplitude 2Vp-p. MatLab shows power 0dB(at)fc
Can somebody say how take into account this 50 Ohm output impedance to get proper power?
starfish said:I am uploading 2 PDF files on Fourier Transform / Spectrum calculation and display in Matlab. I used it for the lab of DSP.
You can also use the below function for displaying the frequency spectrum in MATLAB. As "N" the number of points for fft increases the spectrum becomes more accurate to the theoratical values.
Here 'signal' is the data vector for which u want to see the frequency spectrum. 't' is the time vector for which the signal exists , 'ts' is the sampling time , 'N' is the number of fourier transform points.
function[freq,mag]=fouriertransform(signal,t,ts,N);
S=fft(signal,N);
CS=[S(N/2+1:N) S(1:N/2)];
freq=[-N/2+1:N/2]/(N*ts);
mag=abs(CS);
figure;
plot(freq,mag);
tavakoliahmad said:hi,
I want to get FFT from non-stationary wave. I know that I should use data window.
I've wrriten a code for it but I don't know my code is correct or not?
please help me
shabzbd said:claudiocamera said:eg Yn=abs(fftshift(fft(y,n)))/N where N is the number of points of the signal and n >N is the number of points of the DFT ( n-N is zero padding).
Why are we dividing by N??
If you could please explain.
Fs=150;
t=0:1/Fs:1;
f=5;
x=square(2*pi*f*t);
nfft=1024;
X=fft(x,nfft);
X=X(1:nfft/2);
xt=abs(X);
f=[0:nfft/2-1]*Fs/nfft;
subplot(2,1,1);
plot(t,x);
subplot(2,1,2);
plot(f,xt);