Reputation: 422
I want to take FFT of speech signal first dividing the signal into 64 sample frames. I can do it by simply using "for" loops. However I'm sure there is a way to do in MATLAB in simpler manner. The thing I'm trying to do is simply: Taking FFT of
x1 = [ 1 2 3 4 6];
x2 = [ 2 3 1 3 5];
x3 = [ 3 3 4 5 6];
x = [x1;x2;x3];
fft(x);
After I search, I realized that there is a parameter in FFT which is "dimension". However in my case, my matrix is 2015X64. How can I generate this new matrix with my original speech signal? When I want to use reshape, it seems that it is not proper to do this. Any help will be appreciated.
Upvotes: 0
Views: 920
Reputation: 112689
I think this does what you want
x = randn(1, 2015*64); % // example data vector
x = reshape(x, 64, []).'; %'// separate x into rows of 64 columns
y = fft(x, [], 2); % // take DFT of each row
Upvotes: 2