Swept frequency sinosoid using a linearly increasing sweep frequency

11 views (last 30 days)
Farah Akhtar
Farah Akhtar on 12 Dec 2019
I'm trying to generate a cosine with varying frequency and plotting it against frequency. The physical significance of the problem is as follows:
I have a periodic function in frequency domain for which I'm trying to calculate its Fourier series. Consequently, I wish to plot the function in frequency domain, the calculate its Fourier Series and reconstruct it using the Fourier coefficeints. The function is as follows:
I'm trying to plot this function from frequency 10MHz to 20MHz. Hence, it should be a sinosoid of increasing frequency as we increase f. For the first step in plotting the entire function, I wanted to render a varying frequency cosine of linearly varying frequencies but that was not successful.
As your comments say, the varying frequency cosine function used in this case would be a ramp. Therefore, the exact integral calculation would require an integral of the ramp which is a parabolic function. I used the following code to calculate and plot the function and get a results that I'm almost certain is incorrect. For one, the amplitude of the cosin is varying which, I believe, it should not and secondly, the result is also not quite smooth as your case. Following is my matlab code and the plot that results:
f_range = 10e6:0.1e6:20e6;
cos_exact = cos((2*pi*delta_R/c).*f_range(1) +(2*pi*delta_R/c).*(f_range(end) - f_range(1)).*f_range.^2./2);
f_range_label = f_range./1e6;
title('VSWR vs Frequency');
xlabel('Frequency f (MHz)');
ylabel('VSWR (-)');
P.S: I have read and refer to the following related question and commented there to ask my own question. However, it seems to have been inactive for a while.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by