FFT and convert the vector to a power of two

2 visualizaciones (últimos 30 días)
Javier
Javier el 11 de Mzo. de 2013
Hi. I am testing an algorithm for automatic identification in case of cerebral paralysis. I wish I apply the algorithm for birds identifications.
the algorithm uses Fast Fourier Transform, but first it converts the vector to a power of 2.
The error is "Subscript indices must either be real positive integers or logicals."
The code is
[x, Fs]=wavread('C:\Users\Javier\Desktop\BioAcustica\rail3.wav'); pow=nextpow2(x); tam=2.^pow; if length(x) ~=tam x(tam)=0; %xxx end size=length(x);
thanks

Respuestas (1)

John Petersen
John Petersen el 11 de Mzo. de 2013
Editada: John Petersen el 11 de Mzo. de 2013
Try
n = length(x);
pow = nextpow2( n )
tam = 2.^pow;
x(n:tam) = 0;

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by