FFT and convert the vector to a power of two
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
John Petersen
2013년 3월 11일
편집: John Petersen
2013년 3월 11일
Try
n = length(x);
pow = nextpow2( n )
tam = 2.^pow;
x(n:tam) = 0;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!