Thread Subject: how can I reduce frequency of a sine wave tia sal22

Subject: how can I reduce frequency of a sine wave tia sal22

From: Rick T

Date: 5 Nov, 2009 20:31:13

Message: 1 of 3

Greetings All

I have the example below which produces 10 cycles
x=linspace(0,1,100);
sig=sin(2*pi*x*10);

plot(sig)
ylabel('sig')

What Type of signal would I need to add/multiple/divide to reduce it's
signal/frequency to 5 cycles? I know I can just change the number 10
to 5 but I need to do it with another signal. what mathematical
operation/signal do I need to use.

I tried these but they don't reduce the frequency to 5
sigmulti=sig.*sig;
sigxx=(sig.*sig);
sigdiv=sigxx./(sig.*sig*2);
sigadd=sig+sig;


tia sal22

Subject: how can I reduce frequency of a sine wave tia sal22

From: Dave Robinson

Date: 6 Nov, 2009 11:33:03

Message: 2 of 3

Rick T <ratulloch@gmail.com> wrote in message <ed0ec526-8f73-4059-b0b7-de4ec68db00d@u25g2000prh.googlegroups.com>...
> Greetings All
>
> I have the example below which produces 10 cycles
> x=linspace(0,1,100);
> sig=sin(2*pi*x*10);
>
> plot(sig)
> ylabel('sig')
>
> What Type of signal would I need to add/multiple/divide to reduce it's
> signal/frequency to 5 cycles? I know I can just change the number 10
> to 5 but I need to do it with another signal. what mathematical
> operation/signal do I need to use.
>
> I tried these but they don't reduce the frequency to 5
> sigmulti=sig.*sig;
> sigxx=(sig.*sig);
> sigdiv=sigxx./(sig.*sig*2);
> sigadd=sig+sig;
>
>
> tia sal22

I am not sure that it is the answer you are looking for, but the normal way of doing this would be to hetrodyne your signal. This would be multiplying your signal by another sine wave. This however gives you a composite output which is the sum of the difference between the two frequencies, and the sum of two frequencies. The normal way to seperate them is with a low pass filter.

In your case (which is why I don't think it is the solution you are looking for), is that to get a difference frequency of 5Hz from your 10Hz signal, you would need to multiply your signal by a signal of 5Hz, which is what you required in the first place. This gives you the composite of a 5Hz signal + a 15Hz signal.

There are other ways of doing it, however I can't think of a simple numerical way of tackling it right at the moment (Probably a failure of imagination on my part currently).
For example if you have a noise free signal, you could generate a thresholded zero crossing signal, throw every other one away, then use what you had left as a trigger to generate a 5Hz square wave, then filter out the higher harmonics.

If you were very smart, you might simulate a phase locked loop, simply use an AC coupled multiplier between the output and comparison input of your loop, then feed in your 10 Hz signal to the other input. The loop would settle with a 5Hz output (squaring a sinewave gives you a frequency of twice the input frequency sitting on a DC level, the AC coupling simply removes the DC component) - must admit I don't think I want that job right at this point in time.

Hope one of the Guru's can help

Regards

Dave Robinson

Subject: how can I reduce frequency of a sine wave tia sal22

From: Wayne King

Date: 6 Nov, 2009 11:55:04

Message: 3 of 3

"Dave Robinson" <dave.robinson@somewhere.biz> wrote in message <hd11hf$e2s$1@fred.mathworks.com>...
> Rick T <ratulloch@gmail.com> wrote in message <ed0ec526-8f73-4059-b0b7-de4ec68db00d@u25g2000prh.googlegroups.com>...
> > Greetings All
> >
> > I have the example below which produces 10 cycles
> > x=linspace(0,1,100);
> > sig=sin(2*pi*x*10);
> >
> > plot(sig)
> > ylabel('sig')
> >
> > What Type of signal would I need to add/multiple/divide to reduce it's
> > signal/frequency to 5 cycles? I know I can just change the number 10
> > to 5 but I need to do it with another signal. what mathematical
> > operation/signal do I need to use.
> >
> > I tried these but they don't reduce the frequency to 5
> > sigmulti=sig.*sig;
> > sigxx=(sig.*sig);
> > sigdiv=sigxx./(sig.*sig*2);
> > sigadd=sig+sig;
> >
> >
> > tia sal22
>
> I am not sure that it is the answer you are looking for, but the normal way of doing this would be to hetrodyne your signal. This would be multiplying your signal by another sine wave. This however gives you a composite output which is the sum of the difference between the two frequencies, and the sum of two frequencies. The normal way to seperate them is with a low pass filter.
>
> In your case (which is why I don't think it is the solution you are looking for), is that to get a difference frequency of 5Hz from your 10Hz signal, you would need to multiply your signal by a signal of 5Hz, which is what you required in the first place. This gives you the composite of a 5Hz signal + a 15Hz signal.
>
> There are other ways of doing it, however I can't think of a simple numerical way of tackling it right at the moment (Probably a failure of imagination on my part currently).
> For example if you have a noise free signal, you could generate a thresholded zero crossing signal, throw every other one away, then use what you had left as a trigger to generate a 5Hz square wave, then filter out the higher harmonics.
>
> If you were very smart, you might simulate a phase locked loop, simply use an AC coupled multiplier between the output and comparison input of your loop, then feed in your 10 Hz signal to the other input. The loop would settle with a 5Hz output (squaring a sinewave gives you a frequency of twice the input frequency sitting on a DC level, the AC coupling simply removes the DC component) - must admit I don't think I want that job right at this point in time.
>
> Hope one of the Guru's can help
>
> Regards
>
> Dave Robinson

Hi, This sounds like a homework problem so I'm reluctant to just give you the code to do it, but it should only be a a couple lines. Here's a hint: Instead of thinking of your signal as sin(2*pi*10*x), think of it as exp(1i*2*pi*10*x). Now think about what happens when you multiply exponentials.....

Hope that helps,
wayne

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com