Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Simulating a message signal for use in AM/FM/PM demonstrations

Status
Not open for further replies.

Froskoy

New Member
Hi,

I'm trying to come up with a function for a signal to be modulated, similar to the signal here, in red.

I'm guessing it will have the form sin(something)+something, but I've got no idea how to get a really good, realistic shape like the one given in the example above. Any ideas for a function simulating a realistic message over a restricted domain?

With many thanks,

Froskoy.
 
Hi,

One way is to use a power series where the coefficients are solved for whatever points you want to include in your message. This leads to some wild signals too that might be nice to have for something like this.

For the AM for example we would be solving for the amplitude. The idea would go like this...

First decide what points you might want in your message signal.
Using those points, construct the equations (here we do a third order series):
y=A3*x^3+A2*x^2+A1*x+A0
where each x takes on the value of time for that given value of y where y is your message signal point.
This will generate four equations in the four unknowns, which when solved gives you an equation that follows those chosen points although it can vary wildly in between those points (this may be good or bad so check your signal first).

Alternately you can use a regression technique for fitting the curve to a power series. To get an idea how this works you can look up second order regression. There are regression techniques for higher order equations which would give you quite a bit of control over what the message signal would look like within a limited time frame.

You might also want to specify whether or not conditionals are allowed in the message signal expression. If conditionals are allowed then we can use statements like:
if 5<=x<10 then y=x^2-1
This leads to message signals with jump discontinuities which may or may not be desired.
 
Last edited:
Hi again,

Oh ok that's great.

You can also include the derivatives of the equations if you want to control the derivatives at some points too. Requires twice as many equations.

Another interesting way to do this is to simply use a few sinusoidal terms added together where the frequencies are harmonically unrelated. I've included a quick example of how easy this is to do. Note that the message would still be of finite length but it would repeat over and over again. See the attached diagram where the generator function is shown down at the lower left.
You can play around with the three amplitudes and the three frequencies and see what you get.
 
Last edited:
That's really cool and has the added advantage that it still gives valid results over an infinite range. Thanks again!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top