<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265115</link>
    <title>MATLAB Central Newsreader - how can I reduce frequency of a sine wave  tia sal22</title>
    <description>Feed for thread: how can I reduce frequency of a sine wave  tia sal22</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 05 Nov 2009 20:31:13 -0500</pubDate>
      <title>how can I reduce frequency of a sine wave  tia sal22</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265115#692527</link>
      <author>Rick T</author>
      <description>Greetings All&lt;br&gt;
&lt;br&gt;
I have the example below which produces 10 cycles&lt;br&gt;
x=linspace(0,1,100);&lt;br&gt;
sig=sin(2*pi*x*10);&lt;br&gt;
&lt;br&gt;
plot(sig)&lt;br&gt;
ylabel('sig')&lt;br&gt;
&lt;br&gt;
What Type of signal would I need to add/multiple/divide to reduce it's&lt;br&gt;
signal/frequency to 5 cycles?  I know I can just change the number 10&lt;br&gt;
to 5 but I need to do it with another signal.  what mathematical&lt;br&gt;
operation/signal do I need to use.&lt;br&gt;
&lt;br&gt;
I tried these but they don't reduce the frequency to 5&lt;br&gt;
sigmulti=sig.*sig;&lt;br&gt;
sigxx=(sig.*sig);&lt;br&gt;
sigdiv=sigxx./(sig.*sig*2);&lt;br&gt;
sigadd=sig+sig;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
tia sal22</description>
    </item>
    <item>
      <pubDate>Fri, 06 Nov 2009 11:33:03 -0500</pubDate>
      <title>Re: how can I reduce frequency of a sine wave  tia sal22</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265115#692651</link>
      <author>Dave Robinson</author>
      <description>Rick T &amp;lt;ratulloch@gmail.com&amp;gt; wrote in message &amp;lt;ed0ec526-8f73-4059-b0b7-de4ec68db00d@u25g2000prh.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; Greetings All&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have the example below which produces 10 cycles&lt;br&gt;
&amp;gt; x=linspace(0,1,100);&lt;br&gt;
&amp;gt; sig=sin(2*pi*x*10);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; plot(sig)&lt;br&gt;
&amp;gt; ylabel('sig')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What Type of signal would I need to add/multiple/divide to reduce it's&lt;br&gt;
&amp;gt; signal/frequency to 5 cycles?  I know I can just change the number 10&lt;br&gt;
&amp;gt; to 5 but I need to do it with another signal.  what mathematical&lt;br&gt;
&amp;gt; operation/signal do I need to use.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I tried these but they don't reduce the frequency to 5&lt;br&gt;
&amp;gt; sigmulti=sig.*sig;&lt;br&gt;
&amp;gt; sigxx=(sig.*sig);&lt;br&gt;
&amp;gt; sigdiv=sigxx./(sig.*sig*2);&lt;br&gt;
&amp;gt; sigadd=sig+sig;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; tia sal22&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
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).&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Hope one of the Guru's can help&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
&lt;br&gt;
Dave Robinson</description>
    </item>
    <item>
      <pubDate>Fri, 06 Nov 2009 11:55:04 -0500</pubDate>
      <title>Re: how can I reduce frequency of a sine wave  tia sal22</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265115#692657</link>
      <author>Wayne King</author>
      <description>&quot;Dave Robinson&quot; &amp;lt;dave.robinson@somewhere.biz&amp;gt; wrote in message &amp;lt;hd11hf$e2s$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Rick T &amp;lt;ratulloch@gmail.com&amp;gt; wrote in message &amp;lt;ed0ec526-8f73-4059-b0b7-de4ec68db00d@u25g2000prh.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Greetings All&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I have the example below which produces 10 cycles&lt;br&gt;
&amp;gt; &amp;gt; x=linspace(0,1,100);&lt;br&gt;
&amp;gt; &amp;gt; sig=sin(2*pi*x*10);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; plot(sig)&lt;br&gt;
&amp;gt; &amp;gt; ylabel('sig')&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; What Type of signal would I need to add/multiple/divide to reduce it's&lt;br&gt;
&amp;gt; &amp;gt; signal/frequency to 5 cycles?  I know I can just change the number 10&lt;br&gt;
&amp;gt; &amp;gt; to 5 but I need to do it with another signal.  what mathematical&lt;br&gt;
&amp;gt; &amp;gt; operation/signal do I need to use.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I tried these but they don't reduce the frequency to 5&lt;br&gt;
&amp;gt; &amp;gt; sigmulti=sig.*sig;&lt;br&gt;
&amp;gt; &amp;gt; sigxx=(sig.*sig);&lt;br&gt;
&amp;gt; &amp;gt; sigdiv=sigxx./(sig.*sig*2);&lt;br&gt;
&amp;gt; &amp;gt; sigadd=sig+sig;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; tia sal22&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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).&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hope one of the Guru's can help&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Regards&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Dave Robinson&lt;br&gt;
&lt;br&gt;
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.....&lt;br&gt;
&lt;br&gt;
Hope that helps,&lt;br&gt;
wayne</description>
    </item>
  </channel>
</rss>

