How to use function toi with GHz frequency?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi all,
I would like to use the function toi https://es.mathworks.com/help/signal/ref/toi.html to generate a plot showing the third-order distortion products from two GHz frequencies 3.6 and 3.7 GHz, however, it shows wrong the central frequencies:
this is the code:
rng default
x = sin(2*pi*3600000000/32*(1:640))+cos(2*pi*3700000000/32*(1:640));
q = x + 0.01*x.^3 + 1e-2*randn(size(x));
toi(q,32)
댓글 수: 0
채택된 답변
David Goodmanson
2020년 2월 17일
Hi Raul
The problem is that you have 32 Hz as a sampling frequency. I assume here that you meant 32GHz. If you look at the time domain plot in fig 1 below, (time axis is not to scale, just shows the general behavior) you get nothing meaningful. That of course carries over to the toi. Figs 3 and 4 show what happens with a 32 GHz sampling frequency. As shown in fig 3, you need to have an adequate number of time points so that the two waves have enough time to beat against each other several times. That allows toi to find good amplitudes for the two intermodulation frequencies, 2f1-f2 and 2f2-f1. The number of time points was upped to 2000.
x = sin(2*pi*3.6e9/32*(1:640))+cos(2*pi*3.7e9/32*(1:640));
figure(1)
plot(x)
grid on
q = x + 0.01*x.^3 + 1e-5*randn(size(x));
figure(2)
toi(q,32)
x = sin(2*pi*3.6e9/32e9*(1:2000))+cos(2*pi*3.7e9/32e9*(1:2000));
figure(3)
plot(x)
grid on
q = x + 0.01*x.^3 + 1e-5*randn(size(x));
figure(4)
toi(q,32e9)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!