필터 지우기
필터 지우기

How to plot Message Signal using MATLAB ?? (Quick Question Need Help)

조회 수: 1 (최근 30일)
PG
PG 2012년 4월 23일
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.

채택된 답변

Richard Brown
Richard Brown 2012년 4월 23일
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])

추가 답변 (2개)

Richard Brown
Richard Brown 2012년 4월 23일
m_1 = @(t) 2*(cos(t) >= 0) - 1
t = linspace(0, 100);
stairs(t, m_1(t))
  댓글 수: 3
Richard Brown
Richard Brown 2012년 4월 23일
No, don't do that, it will be horrible!! (not wrong, just horrible)
See new answer below
PG
PG 2012년 4월 23일
Well the question asks to find the corresponding FM signal for frequency = 1 in the equation
FM transmitter:
y(t) = cos(2pi*t + 2pi(frequency) * integral (0 to t) of m(tau) dtau
so how would i do that?

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2012년 4월 23일
Try a stair plot.
  댓글 수: 1
PG
PG 2012년 4월 23일
but m_1(t) changes value all the time, so its not constant..
it's basically a bunch of unit step functions added together but i don't know how to code that ..

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by