FFT on a segment of a signal
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hi, i am trying to analyse a signal in a .wav file by performing FFT on the signal. however i only want to perform the FFT on a particular segment of the signal at the range around the maximum point of the signal. have tried google-ing around for help on the code to segment out the signal but cant seem to work. can anyone guide mi on this?
1 comentario
Andreas Goser
el 5 de Feb. de 2011
There are 2 aspects of your code - findinf a maximum and the doing the fft. Without an example, it is difficult to say what fails.
Respuesta aceptada
José Goulart
el 5 de Feb. de 2011
Function findpeaks() finds all the local maxima on your data. After that you would have to find the largest of the points returned.
In this case, if you just want to take the neighbourhood around the maximum point of the data, it is simpler to use max() function.
First note that, as your data is an audio signal, you should call it passing absolute values of your data as argument in order to consider both positive and negative peaks.
Here is the code:
>> abdata = abs(DataArray);
>> [mx,pmx] = max(DataArray);
>> N = 1024; %for instance
>> dataToFFT = DataArray(pmx-N:pmx+N-1);
After that, just compute the FFT normally.
Más respuestas (1)
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!