Applying a phase shift to a complex signal vector

31 次查看(过去 30 天)
Hello!
I am trying to apply a phase shift to a complex signal vector for a small projecct and can't quite figure out how to do it: heres my current code:
%Form Complex matrices
x1 = complex(x1_Re, x1_Im);
x1=double(x1);
x0 = complex(x0_Re, x0_Im);
x0 = double(x0);
%Unshift the signals
Shift_tile0 = deg2rad(-151.093);
unshifted_signal0 = x0 .* exp(-1i * Shift_tile0);
Shift_tile1 = deg2rad(-86.0178);
unshifted_signal1 = x1 .* exp(-1i * Shift_tile1);
I am on MATLAB 2022b, and the sampling frequencies for x1,x0 are known. I am building x1 and x0 from the I and Q data received.

回答(1 个)

William Rose
William Rose 2024-5-24
编辑:William Rose 2024-5-24
[Edit: In case it is not obvious, x is the original signal, and y is the phase-shifted signal.]
Since you are working with I-Q signals, make an I and Q signal that are 90 degrees apart, since this is what In-phase and Quadrature mean. In the example below, a phase shift of -60 degrees is applied.
dt=1e-2; t=(0:99)*dt; % time vec tor (s)
T=0.2; % period (s)
x=cos(2*pi*t/T)+1i*sin(2*pi*t/T);
% Apply phase shift
phi=-pi/3;
y=x*exp(1i*phi);
% Plot results
figure
plot(t,real(x),'-r',t,imag(x),'-b',t,real(y),'--r',t,imag(y),'--b');
legend('x_{Real}','x_{Imag}','y_{Real}','y_{Imag}');
xlabel('Time (s)'); ylabel('Amplitude')
Looks reasonable. Good luck.

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by