Applying Blockproc on wav audio

2 次查看(过去 30 天)
Jin
Jin 2012-10-29
Hi all,
I'm trying to block process a discrete cosine transform on a wav audio file.
From what I understand the first argument in the function should be the wav file, imported into the workspace with wavread, the second the block size and lastly the function(dct). after checking the size of the file, I see that the signal is a 4583460x2 matrix (stereo).
So my code for the blockproc is,
y = blockproc('SlavicMood.wav', [256 2], dct)
but I get an error,
??? Error using ==> dct at 29 Not enough input arguments
Does anyone know what this error means, and what the 'input argument' is referring to? I am a beginner in Matlab so any help would be greatly appreciated.
Cheers!

回答(1 个)

Sean de Wolski
Sean de Wolski 2012-10-29
You need to use the function handle to dct, i.e. @dct.
y = blockproc('SlavicMood.wav', [256 2], @dct)

Community Treasure Hunt

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

Start Hunting!

Translated by