Csound Csound-dev Csound-tekno Search About

[Cs-dev] build biquad filter with delay opcode

Date2013-02-07 14:27
Fromdudat
Subject[Cs-dev] build biquad filter with delay opcode
hi everybody.. i'm trying to build a biquad filter using delay line.
so, if i've understood the biquad it should be a iir filter of second order
and i've built it in this way 

instr 1
arec2 init 0
arec3 init 0
a1 rand 1000
arec2 delay a1+arec2, 6/44100
arec3 delay a1+arec3, 40/44100
arecout = arec2+arec3
out aout+arecout, aout+arecout
endin

could someone tell me if it's right ?

Thanks !



--
View this message in context: http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-02-08 12:16
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] build biquad filter with delay opcode
Assuming you do not want to use the biquad opcode I would have thought
that using delay1 would be more appropriate; not sure why you want to
delay by 0 or 40 samples.  Also I would expect to see coefficients to the
delayed signals.

Usually a biquad has a FIR component so you would need 4 delays; or hae I
misunderstood what you are doing?

==John ff

> hi everybody.. i'm trying to build a biquad filter using delay line.
> so, if i've understood the biquad it should be a iir filter of second
> order
> and i've built it in this way
>
> instr 1
> arec2 init 0
> arec3 init 0
> a1 rand 1000
> arec2 delay a1+arec2, 6/44100
> arec3 delay a1+arec3, 40/44100
> arecout = arec2+arec3
> out aout+arecout, aout+arecout
> endin
>
> could someone tell me if it's right ?
>
> Thanks !
>
>
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-02-08 19:48
Fromdudat
SubjectRe: [Cs-dev] build biquad filter with delay opcode
Thanks for the reply ! yes i don't want to use the biquad opcode because i
would understand how it works and how built it  the delay time i used is
just for trying.

i read on this website
http://www.minidsp.com/applications/advanced-tools/advanced-biquad-programming
that biquad is a 2nd order recursive filter, but probably i'm not
undestanding.
anyway how you are saying i should do something like this:

a1 delay ain, time
a2 delay a1, time
a3 delay ain, time
a4 delay a3, time
out ain+a1+a2-a3-a4

because in the graph there are 4 delay lines but they are two sequentially
couple. it's right ?



--
View this message in context: http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960p5720019.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-02-08 19:52
Fromdudat
SubjectRe: [Cs-dev] build biquad filter with delay opcode
Thanks for the reply ! yes i don't want to use the biquad opcode because i
would understand how it works and how built it  the delay time i used is
just for trying.

i read on this website
http://www.minidsp.com/applications/advanced-tools/advanced-biquad-programming
that biquad is a 2nd order recursive filter, but probably i'm not
undestanding.
anyway how you are saying i should do something like this:

a1 delay ain, time
a2 delay a1, time
a3 delay ain, time
a4 delay a3, time
out ain+a1+a2-a3-a4

because in the graph there are 4 delay lines but they are two sequentially
couple. it's right ?



--
View this message in context: http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960p5720020.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-02-08 23:05
FromVictor Lazzarini
SubjectRe: [Cs-dev] build biquad filter with delay opcode
Delay will not be the right thing. Here's the code for a biquad filter for you
(ksmps=1)

az1 init 0                          /* 1-sample delay */
az2 init 0                          /* 2-sample delay */
aw = ain - az1*kb1  - az2*kb2   /* feedback   */
aout = aw*ka0 + az1*ka1 + az2*ka2       /* feedforward */
az2 = az1                           /* update the delays */
az1 = aw




On 8 Feb 2013, at 19:48, dudat wrote:

> Thanks for the reply ! yes i don't want to use the biquad opcode because i
> would understand how it works and how built it  the delay time i used is
> just for trying.
> 
> i read on this website
> http://www.minidsp.com/applications/advanced-tools/advanced-biquad-programming
> that biquad is a 2nd order recursive filter, but probably i'm not
> undestanding.
> anyway how you are saying i should do something like this:
> 
> a1 delay ain, time
> a2 delay a1, time
> a3 delay ain, time
> a4 delay a3, time
> out ain+a1+a2-a3-a4
> 
> because in the graph there are 4 delay lines but they are two sequentially
> couple. it's right ?
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960p5720019.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013 
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-02-09 16:57
Fromdudat
SubjectRe: [Cs-dev] build biquad filter with delay opcode
hi, thanks ! but i can't undestand two things.. first how are you creating a
delayed line with out delay ? . second, what does the line do where you say
"update the delays" ?
thanks ! i'm sorry but i'm new with csound ! ^^



--
View this message in context: http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960p5720033.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-02-09 21:54
FromVictor Lazzarini
SubjectRe: [Cs-dev] build biquad filter with delay opcode
For a biquad you only need 1 and 2 sample delays. If you read the code you will see that
the variables az1 and az2 hold signals that are delay by 1 and 2 samples each.

Victor

On 9 Feb 2013, at 16:57, dudat wrote:

> hi, thanks ! but i can't undestand two things.. first how are you creating a
> delayed line with out delay ? . second, what does the line do where you say
> "update the delays" ?
> thanks ! i'm sorry but i'm new with csound ! ^^
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/build-biquad-filter-with-delay-opcode-tp5719960p5720033.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013 
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net