mode and amplitude

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

mode and amplitude

Stefan Thomas-2
Dear community,
I would once more like to ask a question about the mode opcode.
If I define different modes with different frequencies, how are there relative amplitudes are balanced?
Are they of equal loudness?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: mode and amplitude

Justin Glenn Smith
Because mode is a filter, the output amplitude will vary based on the settings of the filter and the frequency components of the input sound. To control amplitude you could use the balance opcode to peg the sum of the filtered sounds to the original input sound. Or you could balance each of the filtered sounds, but to some degree I think this would be undermining the purpose of the opcode.

Stefan Thomas wrote:

> Dear community,
> I would once more like to ask a question about the mode opcode.
> If I define different modes with different frequencies, how are there
> relative amplitudes are balanced?
> Are they of equal loudness?
>
> 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: mode and amplitude

Stefan Thomas-2
Dear Justin,
thanks for Your answer.
As far as I understood, reading some mails from this list, the mode-opcode is related to the biquad-filter, isn't it?
I've read in the csound-manual:
ares biquad asig, kb0, kb1, kb2, ka0, ka1, ka2 [, iskip]

But unfortunately I didn't find an explanation for kb0, kb1 (bandwith?) and ka0, ka1
I would like to understand what this filter does.

Am 12. Februar 2012 22:07 schrieb Justin Glenn Smith <[hidden email]>:
Because mode is a filter, the output amplitude will vary based on the settings of the filter and the frequency components of the input sound. To control amplitude you could use the balance opcode to peg the sum of the filtered sounds to the original input sound. Or you could balance each of the filtered sounds, but to some degree I think this would be undermining the purpose of the opcode.

Stefan Thomas wrote:
> Dear community,
> I would once more like to ask a question about the mode opcode.
> If I define different modes with different frequencies, how are there
> relative amplitudes are balanced?
> Are they of equal loudness?
>
> 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: mode and amplitude

Justin Glenn Smith
For starters, a digital filter is usually a set of delay lines with different amplitudes applied to them. A biquad filter is one of the basic digital filters. In practice an engineer will usually use an application or formula where they describe properties they want in the filter (bandwidth, center frequency, highpass vs. lowpass vs. bandpass etc.) and it will spit out coefficients for a biquad filter.

You can think of an opcode like mode or butterbp etc. as user friendly frontends where csound takes care of the filter design - under the hood it sets up one or more biquad filters in various configurations. Some of the csound filters use other, non biquad filters, for example lowres and lowpass2 don't specify their filter types, but they are probably digital low pass filters (an easier diagram to read, but less linear than biquad in frequency response).

for starters here is the page for the biquad filter on Wikipedia:
http://en.wikipedia.org/wiki/Digital_biquad_filter

The arguments to the biquad opcode are exactly the variables in the equation described on that page.
the kbx arguments are the zeros which happen to be amplitudes of non feedback delays (well b0 is a delay of zero which is the same as no delay really...) and the kax arguments are the poles, which happen to be the amplitues of the feedback delays. There is no a0, because in order to feed back you need at least a delay of one sample.


The basic gist of it without the numbers is that by combining short (one or two sample) delays at various amplitudes (with feedback back into the filter from the filter's output), you cancel out some frequencies while amplifying others. If you consider the fact that sound is modified by a space like a room or a body of an instrument, where echoes interfere or reinforce depending on wavelength, it is a digital translation of that physical phenomenon. The arguments to the biquad opcode represent the relative levels of the various delays / feedbacks.

tl;dr: if you don't understand biquad, you could take a class on Digital Signal Processing or teach yourself some DSP or just use one of the more user friendly filters (which are less flexible but more usable for non-engineers).

Stefan Thomas wrote:

> Dear Justin,
> thanks for Your answer.
> As far as I understood, reading some mails from this list, the mode-opcode
> is related to the biquad-filter, isn't it?
> I've read in the csound-manual:
>
> ares *biquad* asig, kb0, kb1, kb2, ka0, ka1, ka2 [, iskip]
>
>
> But unfortunately I didn't find an explanation for kb0, kb1 (bandwith?) and
> ka0, ka1
> I would like to understand what this filter does.
>
> Am 12. Februar 2012 22:07 schrieb Justin Glenn Smith <[hidden email]>:
>
>> Because mode is a filter, the output amplitude will vary based on the
>> settings of the filter and the frequency components of the input sound. To
>> control amplitude you could use the balance opcode to peg the sum of the
>> filtered sounds to the original input sound. Or you could balance each of
>> the filtered sounds, but to some degree I think this would be undermining
>> the purpose of the opcode.
>>
>> Stefan Thomas wrote:
>>> Dear community,
>>> I would once more like to ask a question about the mode opcode.
>>> If I define different modes with different frequencies, how are there
>>> relative amplitudes are balanced?
>>> Are they of equal loudness?
>>>
>>> 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"
>>
>>
>
> 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...