The Fourier transform is one of the most useful mathematical tools for many fields of science and engineering. The Fourier transform has applications in signal processing, physics, communications, geology, astronomy, optics, and many other fields. This technique transforms a function or set of data from the time or sample domain to the frequency domain. This means that the Fourier transform can display the frequency components within a time series of data. The Discrete Fourier Transform (DFT) transforms discrete data from the sample domain to the frequency domain. The Fast Fourier Transform (FFT) is an efficient way to do the DFT, and there are many different algorithms to accomplish the FFT. Matlab uses the FFT to find the frequency components of a discrete signal.
The following is an example of how to use the FFT to analyze an audio file in Matlab. The file in this example is the recording of a tuning fork resonating at the note A4. This shows how the Fourier transform works and how to implement the technique in Matlab.
%Fourier Transform of Sound File %Load File file = 'C:\MATLAB7\work\abc_A4'; [y,Fs,bits] = wavread(file); Nsamps = length(y); t = (1/Fs)*(1:Nsamps) %Prepare time data for plot %Do Fourier Transform y_fft = abs(fft(y)); %Retain Magnitude y_fft = y_fft(1:Nsamps/2); %Discard Half of Points f = Fs*(0:Nsamps/2-1)/Nsamps; %Prepare freq data for plot %Plot Sound File in Time Domain figure plot(t, y) xlabel('Time (s)') ylabel('Amplitude') title('Tuning Fork A4 in Time Domain') %Plot Sound File in Frequency Domain figure plot(f, y_fft) xlim([0 1000]) xlabel('Frequency (Hz)') ylabel('Amplitude') title('Frequency Response of abc A4')
The FFT is finished using the “fft” characteristic. Matlab has no “dft” feature, because the FFT computes the DFT precisely. Only the significance of the FFT is stored, even though the phase of the FFT is useful is a few applications. The “fft” function lets in the range of factors outputted through the FFT to be unique, but for this example, we can use the equal number of input and output factors. In the following line, 1/2 of the factors within the FFT are discarded. This is completed for the functions of this situation, however for many programs, the whole spectrum is thrilling. In the subsequent line, the facts with the intention to be used for the abscissa is ready with the aid of using the sampling frequency and the quantity of samples in the time area. This step is essential to decide the real frequencies contained inside the audio records.
Next, the original data are plotted inside the time domain and the FFT of the statistics is plotted. The x-axis is confined to the range [0, 1000] in this plot to show greater detail at the height frequency. Notice that the frequency response contains a spike at about 440 Hz, that's the frequency of the note A4. There is also very little content material at different frequencies, which is anticipated for a tuning fork. For other instruments, together with a guitar, harmonics at multiples of the height frequency would be visible inside the frequency reaction.
The Fourier transform is a useful tool in many different fields. Two-dimensional Fourier transforms are often used for images as well. Try the code above for yourself to see if you can get the same results.
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.