How to plot Message Signal using MATLAB ?? (Quick Question Need Help)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I have an output for a FM transmitter in the form:
y(t) = cos ( 2*pi*t + 2*pi (integral from 0,t of m(tau) dtau ) )
I need to create a message signal of the following:
m_1(t) =
{
1 when cos(t) >= 0
-1 when cos(t) < 0
}
I need to create the message signal above in MATLAB and then find the corresponding FM signal.
However, I am unclear on how to graph the message signal.. Can you please show me how?
Thank you.
0 Kommentare
Akzeptierte Antwort
Richard Brown
am 23 Apr. 2012
First, note that the integral of the message will be zero up to any multiple of 2*pi. The integral will then be a piecewise linear function that only requires evaluating on [0,2*pi). It's straightforward to do this by hand
pp = interp1([0, pi/2, 3*pi/2, 2*pi], [0, pi/2, -pi/2, 0], 'linear', 'pp');
int_m = @(t) ppval(pp, mod(t, 2*pi));
Then a plot of your FM signal will be
fplot(@(t) cos(2*pi*t) + 2*pi*(int_m(t)), [0 20])
Weitere Antworten (2)
Richard Brown
am 23 Apr. 2012
m_1 = @(t) 2*(cos(t) >= 0) - 1
t = linspace(0, 100);
stairs(t, m_1(t))
3 Kommentare
Richard Brown
am 23 Apr. 2012
No, don't do that, it will be horrible!! (not wrong, just horrible)
See new answer below
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!