DSPRelated.com
Forums

fftshift of the fft of the fftshift (x(t))

Started by roge...@gmail.com November 13, 2008
Hi everyone,
could somebody explain to me why is it necessary to do the fftshift(fft(fftshift(x))) where x is a 'temporal' signal?

I know that the fftshift function makes a shift to fix the 0,2Pi to -Pi,Pi problem, but why do I have to do the first ffshift?

Is there any problem with the phase of the signal or something?

Thanks!
You can find a tutorial submitted to Matlab about this topic
Guide to use FFT 2nd Edition
Daniele Disco
http://www.mathworks.com/matlabcentral/fileexchange/5654

bye

On Thu, Nov 13, 2008 at 5:21 PM, wrote:

> Hi everyone,
> could somebody explain to me why is it necessary to do the
> fftshift(fft(fftshift(x))) where x is a 'temporal' signal?
>
> I know that the fftshift function makes a shift to fix the 0,2Pi to -Pi,Pi
> problem, but why do I have to do the first ffshift?
>
> Is there any problem with the phase of the signal or something?
>
> Thanks!
>
>
I dont see why you need 2 fftshifts; what exactly are you trying to accomplish when you find it necessary?

Amit Pathania

--- On Thu, 11/13/08, r...@gmail.com wrote:
From: r...@gmail.com
Subject: [matlab] fftshift of the fft of the fftshift (x(t))
To: m...
Date: Thursday, November 13, 2008, 9:51 PM

Hi everyone,

could somebody explain to me why is it necessary to do the fftshift(fft( fftshift( x))) where x is a 'temporal' signal?

I know that the fftshift function makes a shift to fix the 0,2Pi to -Pi,Pi problem, but why do I have to do the first ffshift?

Is there any problem with the phase of the signal or something?

Thanks!
Hi again,

I have been trying what I was telling you in this thread and I think I got it. I do not why, but the phase of a transformed signal is different if the fftshift is used in both the temporal and frequency domains or only in one.

I leave here the script and tell me what you think please.
Thanks.

function p2
% using the centeredfft function

Fs00;
Ts=1/Fs;
t=-2:Ts:2-Ts;
x=2*rectpuls(t,0.01);

[X,faxe]=shcenteredFFT(x,Fs); % FT with fftshift(fft(fftshift(x)))
ph=unwrap(angle(X));

[X2,faxe2]teredFFT(x,Fs); % FT with fftshift(fft(x))
ph2=unwrap(angle(X2));

figure(1);
subplot(3,1,1)
plot(t,x,'color','b','LineStyle','--','LineWidth',2); xlabel('seconds'); ylabel('amplitude'); title('x(t)');
xlim([-.05 .05]); ylim([-0.5 3]); grid on;

subplot(3,1,2)
plot(faxe,abs(X)); xlabel('Hertzs'); ylabel('amplitude'); title('X(f)');
xlim([-600 600]); ylim([-.5 3]); grid on;

subplot(3,1,3)
plot(faxe,ph); xlabel('Hertzs'); ylabel('radians'); title('Angle X(f)');
grid on;

figure(2);
subplot(3,1,1)
plot(t,x,'color','b','LineStyle','--','LineWidth',2); xlabel('seconds'); ylabel('amplitude'); title('x(t)');
xlim([-.05 .05]); ylim([-0.5 3]); grid on;

subplot(3,1,2)
plot(faxe2,abs(X2)); xlabel('Hertzs'); ylabel('amplitude'); title('X(f)');
xlim([-600 600]); ylim([-.5 3]); grid on;

subplot(3,1,3);
plot(faxe2,ph2,'color','r'); xlabel('Hertzs'); ylabel('radians'); title('Angle X(f)');
grid on;

Hi everyone,
>could somebody explain to me why is it necessary to do the fftshift(fft(fftshift(x))) where x is a 'temporal' signal?
>
>I know that the fftshift function makes a shift to fix the 0,2Pi to -Pi,Pi problem, but why do I have to do the first ffshift?
>
>Is there any problem with the phase of the signal or something?
>
>Thanks!
Hi,
can somebody help me how to transmit a MB-OFDM code in UWB channel? Let say I have 200 symbols with 165 no of samples. I try to run the UWB channel model codes from the MATLAB exchange files in the internet but I found that the impulse response (h) matrix for 100 number of channel is 7000X100.So, how can I relate this impulse response to my transmitted data?

TQ in advanced..

Anne Na