필터 지우기
필터 지우기

taking FFT from a part of the signal

조회 수: 2 (최근 30일)
Negar
Negar 2013년 9월 21일
Hello all, I have a sound signal in time domain , How can I take the FFT of a excerpt of it, say a 40ms section from 0.026sec to 0.3sec? Ive just been able to plot that segment in time domain, but I can not figure out how to plot its spectrum.. Here is my code, I hope someone can make it done.. Cheers,
clear all
close all
clc
%%Loading,Plotting and Listening to the signal
figure
[signal,Fs,nbits,opts] = wavread('stry.wav'); % Load
tSampling=1/Fs;
n=length(signal);
t=(0:n-1)*tSampling; %Making the time vector
plot(t,signal); % Plot
sound(signal,Fs); % Listen
%%2)Plot a 40ms section in the middle of the vowel /iy/
figure
plot(t,signal)
axis([0.3 0.34 -0.2 0.2]);
%%Taking FFT
signalF=fft(signal(0.03:0.34),1024);
fAxis=-Fs/2:Fs/1024:Fs/2-Fs/1024; %Making the frequency vector
plot(fAxis,abs(signalF));
title('Spectrum of signal(t)');
xlabel('Frequency (Hz)');
ylabel('|signal(f)|');

채택된 답변

Matt J
Matt J 2013년 9월 21일
편집: Matt J 2013년 9월 21일
You mean you want to do a Short Time Fourier Transform (STFT)? If so, there are a number of offerings on the File Exchange, e.g.
  댓글 수: 3
Matt J
Matt J 2013년 9월 21일
signal(t>=300 & t<=340)
Negar
Negar 2013년 9월 22일
Thank you Matt J :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by