I have magnitude and phase of signal in frequency domain and I need to have it in time domain. I know I have to use ifft function, but I heard about mirroring and concatenating these values and I'm kinda lost. I'd appreciate any help with that
I have tried doing something like this, but I'm clearly missing the point
%A - magnitude
z = A .* exp(i*phase);
X = ifft(z);
figure, plot(abs(X))
figure, plot(angle(X))
These are my magnitude and phase in frequency domain

 Réponse acceptée

Star Strider
Star Strider le 10 Sep 2020

1 vote

First, the phase must be in radians, and the highest frequency in both plots must be the Nyquist frequency for any inversion to work.
Then, experiment with this:
Fs = 2*max(frequency_vector)
t = linspace(0, 2*numel(frequency_vector), 2*numel(frequency_vector)).'/Fs; % Time Vector
z = [A(:) .* exp(1i*phase(:)); conj(A(:) .* exp(1i*phase(:)))]; % Force Column Vectors & Concatenate
X = ifft(z);
figure
plot(t, real(X))
There should not be any imaginary values in ‘X’, however they could be present although extremely small, so this would be the approach I would take. Depending upon how ‘z’ was calculated, there could be a scaling issue of numel(t)/2 that it could be necessary to multiply by to recover ‘X’ correctly.
I cannot be certain that this will work with your data, however it should at least get you started.

2 commentaires

NASRIN AKTER
NASRIN AKTER le 18 Fév 2023
Hello
I have 2 signals and between their frequency spectrum I was expecting for a shift in frequency at maximum amplitude. I got a shift but how do I prove that this frequency shift is not because of a phase shift in time domain? I am attaching an image of the signals.
Thanks in advance
Star Strider
Star Strider le 18 Fév 2023
Please post this as a new Question. It does not actually pertain to this problem, and there is not enuogh information. I will delete it and this Comment in a few hours.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by