Borrar filtros
Borrar filtros

I am getting different values of fft for the same variable as demonstrated by a simple example below...

6 visualizaciones (últimos 30 días)
E=[1 2 4 6;3 6 3 9;7 5 8 9]
E = 3x4
1 2 4 6 3 6 3 9 7 5 8 9
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
EF=fftshift(abs(fft(E)))
EF = 3x4
4.5826 3.0000 5.2915 3.6056 15.0000 24.0000 11.0000 13.0000 4.5826 3.0000 5.2915 3.6056
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ES=fftshift(abs(fft(E(:,1))))
ES = 3x1
5.2915 11.0000 5.2915
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
shouldn't ES be equal to the first row of EF...

Respuestas (1)

Paul
Paul el 11 de Mayo de 2024
I think you were expecting ES be equal to the first column of EF.
If desired for fftshift to work along a specific dimension of the input, then that dimension needs to be specified
E=[1 2 4 6;3 6 3 9;7 5 8 9];
EF=fftshift(abs(fft(E)),1) % specify the dimension
EF = 3x4
5.2915 3.6056 4.5826 3.0000 11.0000 13.0000 15.0000 24.0000 5.2915 3.6056 4.5826 3.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ES=fftshift(abs(fft(E(:,1))))
ES = 3x1
5.2915 11.0000 5.2915
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
If that second argument to fftshift is not specified, then the the 2D input is assumed to be a 2D fft, as might be produced from fft2, and the shifting is done in both dimensions.

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by