1 / 5

FFT Examples with Matlab

FFT Examples with Matlab. Guofeng Deng. Matlab Program. X = wavread('sound1.wav'); Fs = 22050; % sampling rate is 22050 Hz N = length(X); if mod(N,2) == 1 N = N-1; end; X = X(1:N); T = N/Fs; % T is the complete sample length in seconds

marged
Download Presentation

FFT Examples with Matlab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FFT Examples with Matlab Guofeng Deng

  2. Matlab Program • X = wavread('sound1.wav'); • Fs = 22050; % sampling rate is 22050 Hz • N = length(X); • if mod(N,2) == 1 • N = N-1; • end; • X = X(1:N); • T = N/Fs; % T is the complete sample length in seconds • fund = 1/T; % the fundamental or lowest frequency • Y = fft(X); • Pyy = Y.*conj(Y)/N; • f = fund*[0:1:N/2-1]; • time = 1/Fs:1/Fs:T; • % raw data • figure(1); • plot(time,X); • title('Original WAV Signal'); • xlabel('time (seconds)'); • % fft result • figure(2); • plot(f,Pyy(1:N/2)); • title('Frequency content of WAV'); • xlabel('Frequency (Hz)'); • % close-up • figure(3); • plot(f(50:2000),Pyy(50:2000)); • title('Frequency content of WAV'); • xlabel('frequency (Hz)');

  3. Examples

  4. Examples

  5. Examples

More Related