Octave - How to properly use loglog with time domain function ?

Thread Starter

thumb2

Joined Oct 4, 2015
122
Hi all,

I have an equation of the form:

\(y(t) = 5\cos(\omega t) + \frac{5}{2}(1 + \cos(2\omega t))\)

and I have to plot the power lines

\(
P_0(\text{dBW}) = G(\text{dB}) + P_i(\text{dBm})\\
P_2(\text{dBW}) = G_2(\text{dB}) + 2 P_i(\text{dBm})\\
\)

in dBW scale using loglog function as it's requested by an exercise and I am quiet confused how to use it.
I started using this code:

Code:
t = linspace(-10, 10, 10000);

f0 = cos(2*pi*t);

f1 = 5*f0;
f2 = 4*f0.^2;

f = figure();
loglog(f1); hold on; grid on; loglog(f2);
waitfor(f);
but of course it's not what I am looking for since I should obtain something like this plot

5810.Image 2.PNG

Do you have any suggestion about how accomplish this ?
Thank you.
 
Top