80 likes | 174 Views
Date: 17 April 07. Lab8 (Signal & System) Instructor: Anan Osothsilp. Date: 17 April 07. Objective: Learn how to obtain frequency response plot using fast Fourier transform. Anan Osothsilp. Page 1. Lab8. Date: 17 April 07. To obtain Frequency response plot of the signal, we need.
E N D
Date: 17 April 07 Lab8 (Signal & System) Instructor: Anan Osothsilp
Date: 17 April 07 Objective: Learn how to obtain frequency response plot using fast Fourier transform Anan Osothsilp Page 1 Lab8
Date: 17 April 07 To obtain Frequency response plot of the signal, we need Load signal file Find length of signal & measurement period (given) Plot frequency versus Magnitude Remove DC bias Identify number of sampling point Find Magnitude vector of output FFT Find frequency range from FFT point and measuring period Calculate output FFT Anan Osothsilp Page 2 Lab8
Date: 17 April 07 To obtain Frequency response plot of the signal, we need Step1: Load signal file load heart.txt ; data = heart; Step2: Find length of signal & measurement period (given) L = length(data); Step 3: Find and Remove DC bias % find dc bias of input signal average_data = sum(data)/length(data); %3 remove dc bias of input signal input = data - average_data; Anan Osothsilp Page 3 Lab8
Date: 17 April 07 To obtain Frequency response plot of the signal, we need Step 4: Identify number of sampling point N = L; Calculate output FFT N = 1024; %number of point for fft N1 = N/2; %number of half spectrum fs = 100; %sampling frequency at 100 Hz input_fft = fft(input,N); %spectrum vector of input signal Anan Osothsilp Page 4 Lab8
Date: 17 April 07 To obtain Frequency response plot of the signal, we need Step 5:Find frequency range from FFT point and measuring period w = ([0:N1-1]/N1)*(fs/2); Step 6: Find Magnitude vector of output FFT abs_input_fft = abs(input_fft(1:N1))*2/N; Anan Osothsilp Page 5 Lab8
Date: 17 April 07 To obtain Frequency response plot of the signal, we need Step 7: Frequency response plot plot(w,abs_input_fft ,'b' ); xlabel('Frequency(Hz)'); ylabel('Mag. of Fourier transform'); grid; Anan Osothsilp Page 6 Lab8
Date: 17 April 07 Exercise1: - Follow 7 steps to obtain frequency plot of given data, by writing Matlab code to remove dc bias calculate FFT of the signal calculate magnitude of FFT plot the magnitude of FFT versus frequency range Identify fundamental frequency of the signal Anan Osothsilp Page 7 Lab8