help needed on dfilt.fftfir

I am pretty much failing to run the following code:
[song,f]=wavread('D:\song.wav'); song=(song(:,1)+song(:,2))/2; cut=song(100000:120000); s1=size(song,1); a=0; s2=size(cut,1); w=ones(s2,1); cc=xcorr(cut,song);
the song is ~12.9 million datapoints.
Errors:
??? Error using ==> fftfilt at 78 Filters of length greater than 2^20 are not supported. Use dfilt.fftfir instead.
Error in ==> xcorr>vectorXcorr at 127 pos_c = flipud(fftfilt(conj(y),flipud(x))); % positive lags
Error in ==> xcorr at 54 [c,M,N] = vectorXcorr(x,autoFlag,varargin{:});
Error in ==> code at 8 cc=xcorr(cut,song);
I searched for dfilt.fftfir, but could not properly use it. I tried using the bugfix on http://www.mathworks.com/support/bugreports/640328
This doesn't work because the attached file is possibly deleted. Could anyone check and confirm?
What should I do to correct this code? Kindly help.

 Risposta accettata

Wayne King
Wayne King il 17 Mag 2012

0 voti

Please see this bug report. It is the same error. There is a work around provided by MathWorks

1 Commento

Vishesh  Vatsal
Vishesh Vatsal il 17 Mag 2012
Thanks. I ran this again. This filter-length error is thankfully not there now. Since the signal is relatively lengthy (~5 min), it seems the code cannot perform an fft now.
Error: ---------------------------------------------------------------------------------------------------------------------------------- ??? Error using ==> fft Out of memory. Type HELP MEMORY for your options.
Error in ==> fftfilt at 129 X = fft(x(istart:iend,:),nfft);
Error in ==> xcorr>vectorXcorr at 127 pos_c = flipud(fftfilt(conj(y),flipud(x))); % positive lags
Error in ==> xcorr at 54 [c,M,N] = vectorXcorr(x,autoFlag,varargin{:});
--------------------------------------------------------------------------------------------------------------------
Is there a workaround this problem or the memory problem cannot be fixed?

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by