Where do these beat frequencies come from?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Where do these beat frequencies come from?

forrest cahoon-2
I've been working with wgpluck2 and I have discovered an interesting phenomenon.

Playing a perfect fifth with notes at 200 and 300 Hz, I notice a
distinct beat frequency in the output. I looked at the output using
Sonic Visualizer and determined the period of the beats to be around
0.42 seconds, or a beat frequency of 2.38 Hz.

The repluck opcode seemed to produce the same beats, and I could hear
the beats with pluck as well, although that fades out and I didn't
mess with that one too much.

I have attached a simple csd which illustrates this.

I have a couple of questions:

1) Where are the beats coming from?  I thought that a plucked string
had integral harmonics, and don't see how I could possibly get a
difference of 2.38 Hz between any integral multiples of 200 and 300. I
tried sawtooth waves generated with vco2, since that waveform contains
all the integral harmonics, and couldn't hear any beats.

2) Is there any analysis tool that can tell me beat frequencies
(especially one that runs on linux?) I used visual inspection of the
waveform this time, but that's tedious and less accurate that an
automated tool would be.

Forrest

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email [hidden email] with body "unsubscribe csound"


perfect_fifth_beats.csd (630 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Where do these beat frequencies come from?

Tito Latini
I have given a look to the code. The beats are caused by two roundings
from floating point to integer number. The lenght of the delay line
used by the model (in samples) is

  len = floor(floor(SR / freq) / 2) * 2

For example:

  iFreq1 = 200
  len1   = floor(floor(44100 / 200) / 2) * 2 = 220

the real frequency is

  44100 / 220 = 200.45454

The other case

  iFreq2 = 300
  len2   = 146

and the real frequency is

  44100 / 146 = 302.0548

The third partial of iFreq1 is 601.36365 and the second partial of
iFreq2 is 604.1096; the diff is 2.7459717

`repluck' and `wgpluck2' use the same (a-rate) code.
Unfortunately you cannot get odd lenghts of the delay lines.

tito

On Sun, Feb 12, 2012 at 10:24:23PM -0600, Forrest Cahoon wrote:

> I've been working with wgpluck2 and I have discovered an interesting phenomenon.
>
> Playing a perfect fifth with notes at 200 and 300 Hz, I notice a
> distinct beat frequency in the output. I looked at the output using
> Sonic Visualizer and determined the period of the beats to be around
> 0.42 seconds, or a beat frequency of 2.38 Hz.
>
> The repluck opcode seemed to produce the same beats, and I could hear
> the beats with pluck as well, although that fades out and I didn't
> mess with that one too much.
>
> I have attached a simple csd which illustrates this.
>
> I have a couple of questions:
>
> 1) Where are the beats coming from?  I thought that a plucked string
> had integral harmonics, and don't see how I could possibly get a
> difference of 2.38 Hz between any integral multiples of 200 and 300. I
> tried sawtooth waves generated with vco2, since that waveform contains
> all the integral harmonics, and couldn't hear any beats.
>
> 2) Is there any analysis tool that can tell me beat frequencies
> (especially one that runs on linux?) I used visual inspection of the
> waveform this time, but that's tedious and less accurate that an
> automated tool would be.
>
> Forrest


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Where do these beat frequencies come from?

Steven Yi
Seems to me that implementing the waveguide in csound code using
deltapx might be the best for accuracy out of what we have available.
Anyone else see something better?

On Mon, Feb 13, 2012 at 10:35 PM, Tito Latini <[hidden email]> wrote:

> I have given a look to the code. The beats are caused by two roundings
> from floating point to integer number. The lenght of the delay line
> used by the model (in samples) is
>
>  len = floor(floor(SR / freq) / 2) * 2
>
> For example:
>
>  iFreq1 = 200
>  len1   = floor(floor(44100 / 200) / 2) * 2 = 220
>
> the real frequency is
>
>  44100 / 220 = 200.45454
>
> The other case
>
>  iFreq2 = 300
>  len2   = 146
>
> and the real frequency is
>
>  44100 / 146 = 302.0548
>
> The third partial of iFreq1 is 601.36365 and the second partial of
> iFreq2 is 604.1096; the diff is 2.7459717
>
> `repluck' and `wgpluck2' use the same (a-rate) code.
> Unfortunately you cannot get odd lenghts of the delay lines.
>
> tito
>
> On Sun, Feb 12, 2012 at 10:24:23PM -0600, Forrest Cahoon wrote:
>> I've been working with wgpluck2 and I have discovered an interesting phenomenon.
>>
>> Playing a perfect fifth with notes at 200 and 300 Hz, I notice a
>> distinct beat frequency in the output. I looked at the output using
>> Sonic Visualizer and determined the period of the beats to be around
>> 0.42 seconds, or a beat frequency of 2.38 Hz.
>>
>> The repluck opcode seemed to produce the same beats, and I could hear
>> the beats with pluck as well, although that fades out and I didn't
>> mess with that one too much.
>>
>> I have attached a simple csd which illustrates this.
>>
>> I have a couple of questions:
>>
>> 1) Where are the beats coming from?  I thought that a plucked string
>> had integral harmonics, and don't see how I could possibly get a
>> difference of 2.38 Hz between any integral multiples of 200 and 300. I
>> tried sawtooth waves generated with vco2, since that waveform contains
>> all the integral harmonics, and couldn't hear any beats.
>>
>> 2) Is there any analysis tool that can tell me beat frequencies
>> (especially one that runs on linux?) I used visual inspection of the
>> waveform this time, but that's tedious and less accurate that an
>> automated tool would be.
>>
>> Forrest
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email [hidden email] with body "unsubscribe csound"
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Where do these beat frequencies come from?

forrest cahoon-2
In reply to this post by Tito Latini
Fascinating. Thank you so much for figuring this out. Now I will be
able to choose a sample rate based on the notes I'm using -- for
instance, in this example, setting sr=42000 makes those beats
disappear.

Forrest

On Mon, Feb 13, 2012 at 4:35 PM, Tito Latini <[hidden email]> wrote:

> I have given a look to the code. The beats are caused by two roundings
> from floating point to integer number. The lenght of the delay line
> used by the model (in samples) is
>
>  len = floor(floor(SR / freq) / 2) * 2
>
> For example:
>
>  iFreq1 = 200
>  len1   = floor(floor(44100 / 200) / 2) * 2 = 220
>
> the real frequency is
>
>  44100 / 220 = 200.45454
>
> The other case
>
>  iFreq2 = 300
>  len2   = 146
>
> and the real frequency is
>
>  44100 / 146 = 302.0548
>
> The third partial of iFreq1 is 601.36365 and the second partial of
> iFreq2 is 604.1096; the diff is 2.7459717
>
> `repluck' and `wgpluck2' use the same (a-rate) code.
> Unfortunately you cannot get odd lenghts of the delay lines.
>
> tito
>
> On Sun, Feb 12, 2012 at 10:24:23PM -0600, Forrest Cahoon wrote:
>> I've been working with wgpluck2 and I have discovered an interesting phenomenon.
>>
>> Playing a perfect fifth with notes at 200 and 300 Hz, I notice a
>> distinct beat frequency in the output. I looked at the output using
>> Sonic Visualizer and determined the period of the beats to be around
>> 0.42 seconds, or a beat frequency of 2.38 Hz.
>>
>> The repluck opcode seemed to produce the same beats, and I could hear
>> the beats with pluck as well, although that fades out and I didn't
>> mess with that one too much.
>>
>> I have attached a simple csd which illustrates this.
>>
>> I have a couple of questions:
>>
>> 1) Where are the beats coming from?  I thought that a plucked string
>> had integral harmonics, and don't see how I could possibly get a
>> difference of 2.38 Hz between any integral multiples of 200 and 300. I
>> tried sawtooth waves generated with vco2, since that waveform contains
>> all the integral harmonics, and couldn't hear any beats.
>>
>> 2) Is there any analysis tool that can tell me beat frequencies
>> (especially one that runs on linux?) I used visual inspection of the
>> waveform this time, but that's tedious and less accurate that an
>> automated tool would be.
>>
>> Forrest
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email [hidden email] with body "unsubscribe csound"
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email [hidden email] with body "unsubscribe csound"

Loading...