"bandwith" of the reson filter.

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
DERF
Posts: 331
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

"bandwith" of the reson filter.

Post by DERF » Thu Aug 29, 2013 8:02 pm

Hello Sirs.
I have a simple question to ask. I would want to know if

Code: Select all

(sum f (mult f 0.5 (lfo fl)))
corresponds to the "center", and if

Code: Select all

(/ f 2.0) 2)
corresponds to the "bandwith" of the reson filter.
Beforehand thank you for your answer.

Moderator note: I split this off from the other (old) thread it was tagged on to - it is always better to start a new thread for a fresh topic.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: "bandwith" of the reson filter.

Post by steve » Sun Sep 01, 2013 11:11 pm

That is not a simple question, it is a mind reading exercise. You have not said where that code comes from or what any of the variables are or how it relates to the "reson" filter.
Surprisingly, my crystal ball is working quite well today ;) and I see that you are referring to this code:

Code: Select all

;control f "medium frequency" int "[Hz]" 1000 100 4000
;control fl "lfo frequency" real "[Hz]" 1 0.1 5

(reson s (sum f (mult f 0.5 (lfo fl)))(/ f 2.0) 2)
From this post: http://forum.audacityteam.org/viewtopic ... 43#p110143

In future, please do not expect my crystal ball to work. Please give the full context of your question (as above) so that other people on the forum can understand what you are asking.
DERF wrote:I would want to know if

Code: Select all

(sum f (mult f 0.5 (lfo fl)))
corresponds to the "center"
"f" corresponds to the "centre".
DERF wrote:corresponds to the "center", and if

Code: Select all

    (/ f 2.0) 2)
corresponds to the "bandwith" of the reson filter.
(/ f 2.0) is half of f.
The "2" at the end specifies the overall RMS value of the amplitude response is 1.0; thus filtered white noise would retain the same power.
http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index426
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DERF
Posts: 331
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

Re: "bandwith" of the reson filter.

Post by DERF » Thu Sep 05, 2013 7:09 pm

I thank steve for the answer.
f corresponds to the "center". But, here is a code:

Code: Select all

 (reson (noise) 100 20 2)
In this code the "center" correspond to 100, the "bandwith" to 20 and "n" to 2. It is right?
Thus, in the complex code, it is the complicated operation [100 + (100 X 0.5) x 2] ( if, for example "f" = 100 and if "fl" = 2) which gives the value of the "center".
Thus, my question is the following one: why to note in a so complicated way the value of the "center"?
I hope that my question is understandable.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: "bandwith" of the reson filter.

Post by steve » Fri Sep 06, 2013 12:15 pm

DERF wrote:In this code the "center" correspond to 100, the "bandwith" to 20 and "n" to 2. It is right?
Yes that's correct.
DERF wrote:why to note in a so complicated way the value of the "center"?

Code: Select all

;control f "medium frequency" int "[Hz]" 1000 100 4000
;control fl "lfo frequency" real "[Hz]" 1 0.1 5

(reson s (sum f (mult f 0.5 (lfo fl)))(/ f 2.0) 2)
The centre of this reson filter is defined by (sum f (mult f 0.5 (lfo fl)))
Note the expression (lfo fl) http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index337
(lfo fl) is a low frequency oscillator. It produces a low frequency sine wave, the frequency of which is set by "fl".
The amplitude of lfo is between 1.0 and -1.0
Try running this:

Code: Select all

(force-srate *sound-srate*
  (lfo 3))
LFO generates a sine wave at 3 Hz. FORCE-SRATE is used to force the sample rate of the sine wave to match the audio track sample rate (LFO would normally generate the sine wave at the "control rate", which is 1/20th of the sound sample rate.

So, let's say that "f" = 100 and "fl" = 1.0
(lfo fl) will produce a sine wave, amplitude +/- 1.0 with a frequency of 1.0 Hz.
(mult 100 0.5 (lfo fl)) will produce a sine wave with an amplitude +/- 50.0
(sum 100 (mult 100 0.5 (lfo fl))) will produce a sine wave with an amplitude +50 to +150.
Thus we have a control signal that rises and falls at 1 cycle per second (1 Hz) between +50 and +150 (the average value is thus 100, which is the value "f").
We then use this control signal to set the centre frequency of the "reson" filter. So the filter does not have a fixed frequency, but has a frequency that rises and falls cyclically at a rate set by "fl" and with an average centre frequency of "f".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DERF
Posts: 331
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

Re: "bandwith" of the reson filter.

Post by DERF » Sun May 17, 2015 9:09 am

Hello.
I have a question to ask. it concerns the value of the "center" of the filter. The value (amplitude) between + 50 and + 150.
These values (+ 50, + 150) correspond to radians?

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: "bandwith" of the reson filter.

Post by steve » Sun May 17, 2015 12:01 pm

DERF wrote:These values (+ 50, + 150) correspond to radians?
Which values? I don't see any values of +50, +150 anywhere on this page.
As I wrote previously, I am not a mind reader.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DERF
Posts: 331
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

Re: "bandwith" of the reson filter.

Post by DERF » Sun May 17, 2015 6:24 pm

Sorry.
The following code

Code: Select all

(sum 100 (mult 100 0.5)(lfo 1)
.It produces a sine wave with an amplitude which oscillates between +50 and +150.I wanted to know if this amplitude which oscillates between 50 and 150 corresponds has a value in radians?
I hoped that my question is understandable.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: "bandwith" of the reson filter.

Post by steve » Sun May 17, 2015 6:35 pm

DERF wrote:

Code: Select all

(sum 100 (mult 100 0.5)(lfo 1)
That code on its own will only produce an error.
If you add a ")" to the end, it will generate a sine wave with a frequency of 1 Hz, a peak-to-peak amplitude of 50 and a DC off-set of 100 at the *control* sample rate.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DERF
Posts: 331
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

Re: "bandwith" of the reson filter.

Post by DERF » Mon May 18, 2015 1:58 pm

Thank you.
I try to understand. Generally, DC offset is a problem.
My question is the following one: in this precise code, as it was able to choose a DC offset of "100" as the following reason: the amplitude is very exactly equal to "50".
Beyond this value ("50"), there would be a problem.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: "bandwith" of the reson filter.

Post by steve » Mon May 18, 2015 3:48 pm

DERF wrote:My question is the following one: in this precise code, as it was able to choose a DC offset of "100" as the following reason: the amplitude is very exactly equal to "50".
Beyond this value ("50"), there would be a problem.
Sorry, I don't understand your question.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply