dissipation in frequency fft

x=rand(1,8); for q=0:7 for r=0:7 if mod(r,2)==0 l(2r+1)=(x(r+1)+x(r+5))*exp(-1i*q*r*pi/2); else l(2r)=((x(r+1)-x(r+5))*exp(-1i*r*pi/2))*exp(-1i*q*r*pi/2); end end X(q+1)=sum(l); end
i got this error Attempted to access x(9); index out of bounds because numel(x)=8. any help

댓글 수: 2

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 4일
Ayman, Are you trying to program fft algorithm?
ayman osama
ayman osama 2012년 12월 4일
yes it's an assignment to make the function using dissipation in frequency instead of using fft

댓글을 달려면 로그인하십시오.

 채택된 답변

John Petersen
John Petersen 2012년 12월 4일
편집: John Petersen 2012년 12월 4일

0 개 추천

Your x vector is too short. You are trying to access up to index 7+5 in your equations. Make x 5 elements larger than the largest r index.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by