|
Dear astro mmi!
> for i=1:200:length(unvoiced)
> ham20=hamming(200); %hamming window of duration 20ms(20ms*1000Hz=200samples)
> unvoiced20=unvoiced(i:i+199).*ham20;
> end
>
> Hello everyone,
> In the above code, I am trying to window a given sequence framebyframe i.e, I am considering that there are 72 windowing operations. The unvoiced20 should be a sequenceof 14400 samples but only 200 samples are generated.
Use the debugger and set a break point in the line:
unvoiced20=unvoiced(i:i+199).*ham20;
There you will find, that the variable unvoiced20 is overwritten in each step of the for loop.
I assume, you want to append the vectors:
unvoiced20 = zeros(1, length(unvoiced)); % EVER preallocate
for i=1:200:length(unvoiced)
ham20 = hamming(200);
unvoiced20(i:i+199) = unvoiced(i:i+199).*ham20;
end
But ham20 is a scalar and the multiplication does not need a loop at all?!
unvoiced20 = unvoiced .* hamming(200);
Perhaps you mean:
ham20 = hamming(1:200); ?!
Than a matrix-multiplication would be much more efficient.
Kind regards, Jan
|