whats this line do?

조회 수: 1 (최근 30일)
itsik
itsik 2011년 5월 26일
y=[zeros(10,20000),x,zeros(10,20000)];
y2=abs(fftshift(fft(real(y(2,:)))))/length(y);
thanks!!!

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 5월 26일
  • It defines y as x padded with 20000 columns on both sides
  • It takes the DFT of the real part of the second row of y, shifts it to 0 takes the absolute value and divides by the length of the row.

추가 답변 (1개)

itsik
itsik 2011년 5월 26일
ok so what this is do? where is the fft take a place? lets say x=[10 X 1000]
y=[zeros(10,20000),x,zeros(10,20000)];
y2=abs(fftshift(fft(real(y(2,:)))))/length(y);
y3=abs(fftshift(fft(real(y(3,:)))))/length(y);
y4=abs(fftshift(fft(real(y(4,:)))))/length(y);
i just cant understand that line : y=[zeros(10,20000),x,zeros(10,20000)];
thanks!
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2011년 5월 26일
It zero pads x with 10x20000 zeros on each side (columnwise)
try it on a small scale
x = magic(3);
y = [zeros(3,10),x,zeros(3,5)]

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

카테고리

Help CenterFile 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