フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how to vectorize .

1 回表示 (過去 30 日間)
serena dsouza
serena dsouza 2018 年 1 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
for i=1:no_frame
temp = downsample(fft_frame(:,i),2); % Down sampling by 2
y2(:,i) = [temp; zeros(NFFT/2 - length(temp), 1)];
temp = downsample(fft_frame(:,i),3); % Down sampling by 4
y3(:,i) = [temp; zeros(NFFT/2 - length(temp), 1)];
temp = downsample(fft_frame(:,i),4); % Down sampling by 8
y4(:,i) = [temp; zeros(NFFT/2 - length(temp), 1)];
end

回答 (1 件)

Greg
Greg 2018 年 1 月 24 日
編集済み: Greg 2018 年 1 月 24 日
You have already preallocated y2, y3, y4 with zeros. Use a row indexing variable to insert temp and stop re-inserting the zeros.
Also, downsample will work along columns. Just remove your loop and uses of the i variable.
For example:
temp = downsample(fft_frame,2); % Down sampling by 2
y2(1:size(temp,1),:) = temp;

タグ

タグが未入力です。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by