Fourier Transformations
Fourier Transformations
Fourier
Transformations
Example:
Define a random signal from three Use FFT function to convert from time domain
signals with 10 30 70 frequencies. to frequency domain
>> Y=fft(X,n)
Tip: Assume random
signal is sum of three X: data of signal
signals with different n: length of that signal
frequencies
%% Define a random signal
Fs=1000;
Ts=1/Fs;
time=[0:Ts:2-Ts];
freq=[10,30,70];
Amp=5;
for i=1:length(freq)
y(i,:)=Amp*sin(2*pi*freq(i)*time);
end
y_random=y(1,:)+y(2,:)+y(3,:)
subplot(4,1,1)
plot(time,y(1,:))
title('signal 1 in the Time Domain')
subplot(4,1,2)
plot(time,y(2,:))
title('signal 2 in the Time Domain')
subplot(4,1,3)
plot(time,y(3,:))
title('signal 3 in the Time Domain')
subplot(4,1,4)
plot(time,y_random)
title('total of three signals')
%% FFT on a random signal
%% length of signal
nfft=length(y_random)