I have a time series (x). I have taken the fft of the time series (X). I want to shift the entire series, or in the future only certain frequency components, by phase shift (theta). I have changed the complex numbers of X to alter the angle whilst conserving the abs(X). I then ifft the output (X2) and I get a complex output and im not sure why?
Thanks
if true
for m=2:length(X)
n=X(m);
r=real(n);
im=imag(n);
a=angle(n);
a2=a+pi/2;
r2=(r*cos(a2))/cos(a);
im2=tan(a2)*r2;
z=complex(r2,im2);
X2(m,1)=z;
end
output=ifft(X2);

Antworten (2)

Dimitris Kalogiros
Dimitris Kalogiros am 31 Aug. 2018

1 Stimme

After the manipulations of fft values X , If abs(X) exhibits even symmetry and angle(X) odd symmetry, then ifft should give back a real value time sequence. Otherwise, ifft results to a complex time series.
Matt J
Matt J am 31 Aug. 2018
Bearbeitet: Matt J am 31 Aug. 2018

0 Stimmen

Shifting the angle by a constant amount for every frequency component will not translate the signal. The translation t0 has to be linearly weighted by frequency.
Also, it is much easier to implement what you have done just by doing,
output=ifft( X.*exp(-j*2*pi*f*t0) )

6 Kommentare

ben howey
ben howey am 31 Aug. 2018
where f has units of Hz and t0 is a phase shift in radians?
Matt J
Matt J am 31 Aug. 2018
t0 is a time shift in seconds.
ben howey
ben howey am 31 Aug. 2018
So is there no way to phase shift components of the spectrum by a given phase angle? i.e taking the component at 0.3 Hz and adding a pi/2 phase shift to make that component z=sin(2*pi*0.3+pi/2)
Matt J
Matt J am 31 Aug. 2018
Bearbeitet: Matt J am 31 Aug. 2018
I think you mean z=sin(2*pi*0.3*(t+pi/2)) ?
ben howey
ben howey am 31 Aug. 2018
*sorry z=sin(wt+pi/2) = sin(2*pi*0.3+pi/2) , where w is omega frequency in rad/s
Matt J
Matt J am 31 Aug. 2018
Bearbeitet: Matt J am 31 Aug. 2018
That is the same as
z=sin(2*pi*0.3*(t+1/1.2))
So yes, it is possible. You would add +/- 1/1.2 to the phase angle of the spectral components at +/- 0.3 Hz.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2016b

Gefragt:

am 31 Aug. 2018

Bearbeitet:

am 31 Aug. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by