필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to vectorize .

조회 수: 2 (최근 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