How to get argument of complex exponential?

4 ビュー (過去 30 日間)
Louis Tomczyk
Louis Tomczyk 2022 年 5 月 29 日
コメント済み: Louis Tomczyk 2022 年 5 月 30 日
Dear all,
I feel a bit ashamed to ask such question but I am quite upset by the outcome of , where z is a chosen complex, which does not give what I expect.
Let's be more precise:
% axis parameters
dt = 6.25e-3*1e-9; % [s] sampling time
Nsamp = 1024*16; % [] number of samples
t = 0:dt:(Nsamp-1)*dt; % [s] array of time values
% signal construction
nu = 193.41e12; % [Hz] frequency
CFO = exp(1i*2*pi*nu.*t); % [] Carrier Frequency Offset signal, so "my z"
% getting the angle
ARG = unwrap(angle(CFO)); % [] it should give an ARRAY of size (1;16,384): 2*pi*nu*t
p = polyfit(t,ARG,1) % [rad/s]it should return [2*pi*nu,0]
p = 1×2
1.0e+11 * -1.8850 0.0000
2*pi*nu
ans = 1.2152e+15
But it does not give the pulsation I used to construct my signal.
What did I miss?
Does anyone have an idea?
Thanks a lot,
Best,
louis

採用された回答

Voss
Voss 2022 年 5 月 29 日
The "sampling time" is not small enough. It must be less than 1/(2*nu) - i.e., sampling rate greater than 2*nu - to avoid aliasing.
nu = 193.41e12; % [Hz] frequency
p0 = 2*pi*nu % target "pulsation"
p0 = 1.2152e+15
fs = 2.01*nu; % sufficient sampling rate
p1 = get_pulsation(nu,fs) % matches target
p1 = 1.2152e+15
fs = 1/(6.25e-3*1e-9); % original sampling rate
p2 = get_pulsation(nu,fs) % does not match
p2 = -1.8850e+11
fs = 1.99*nu; % *nearly* sufficient sampling rate
p3 = get_pulsation(nu,fs) % does not match
p3 = -1.2031e+15
function out = get_pulsation(nu,fs)
% signal construction
dt = 1/fs; % [s] sampling time
Nsamp = 1024*16; % [] number of samples
t = 0:dt:(Nsamp-1)*dt; % [s] array of time values
CFO = exp(1i*2*pi*nu.*t); % [] Carrier Frequency Offset signal, so "my z"
% getting the angle
ARG = unwrap(angle(CFO)); % [] it should give an ARRAY of size (1;16,384): 2*pi*nu*t
p = polyfit(t,ARG,1); % [rad/s]it should return [2*pi*nu,0]
out = p(1);
end
  1 件のコメント
Louis Tomczyk
Louis Tomczyk 2022 年 5 月 30 日
Dear @_,
I did not even think about the sampling issue which is totally obvious finally.
This is a perfect example of how coding is useless if we don't know a bit of maths ^_^
Many thanks :)
Best,
louis

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by