DSPRelated.com
Forums

Question regarding Faust for DSP

Started by Mauritz Jameson July 26, 2014
I have been given a problem to solve, but I'm having a hard time understanding the syntax and thus also how I'm supposed to solve the problem.

The problem is stated here:

http://wikisend.com/download/255078/faust.zip

I'm hoping that there's a Faust expert in this group who could take a look at it and tell me what this is all about.


Thanks
On Sat, 26 Jul 2014 07:26:11 -0700 (PDT), Mauritz Jameson
<mjames2393@gmail.com> wrote:

>I have been given a problem to solve, but I'm having a hard time understanding the syntax and thus also how I'm supposed to solve the problem. > >The problem is stated here: > >http://wikisend.com/download/255078/faust.zip > >I'm hoping that there's a Faust expert in this group who could take a look at it and tell me what this is all about. > > >Thanks
Security-conscious people will generally not open a zip file that's not from a trusted source (for what are hopefully obvious reasons). You may get more interest by posting it plainly. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
Ok. Here's a plain text file:

http://wikisend.com/download/524862/faust.txt

You might like this one better:

http://textuploader.com/knk8

On 7/26/14 11:38 AM, Mauritz Jameson wrote:
> You might like this one better: > > http://textuploader.com/knk8 >
Mauritz, why wouldn't you just post it? i write posts all the time that are longer. anyway now i gotta read it. get back to you. _______________________________________________________________________ Delay-Equalizing Allpass Filters Please implement 7th and 9th order delay-equalizing allpass filters by extending the following code. In particular, the 3rd and 5th order filters have already been implemented in the code. Using those as a base model, please implement 7th and 9th order. Look for the words &#4294967295;FIXME&#4294967295; below to see where to work on this. //======= Special Filter-Bank Delay-Equalizing Allpass Filters ======== // // These special allpass filters are needed by filterbank et al. below. // They are equivalent to (lowpass(N,fc) +|- highpass(N,fc))/2, but with // canceling pole-zero pairs removed (which occurs for odd N). //-------------------- lowpass_plus|minus_highpass ------------------ highpass_plus_lowpass(1,fc) = _; highpass_plus_lowpass(3,fc) = tf2s(1,-1,1,1,1,w1) with { w1 = 2*PI*fc; }; highpass_minus_lowpass(3,fc) = tf1s(-1,1,1,w1) with { w1 = 2*PI*fc; }; highpass_plus_lowpass(5,fc) = tf2s(1,-a11,1,a11,1,w1) with { a11 = 1.618033988749895; w1 = 2*PI*fc; }; highpass_minus_lowpass(5,fc) = tf1s(1,-1,1,w1) : tf2s(1,-a12,1,a12,1,w1) with { a12 = 0.618033988749895; w1 = 2*PI*fc; }; // Catch-all definitions for generality - even order is done: highpass_plus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with { switch_odd_even(0,N,fc) = highpass_plus_lowpass_even(N,fc); switch_odd_even(1,N,fc) = highpass_plus_lowpass_odd(N,fc); }; highpass_minus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with { switch_odd_even(0,N,fc) = highpass_minus_lowpass_even(N,fc); switch_odd_even(1,N,fc) = highpass_minus_lowpass_odd(N,fc); }; highpass_plus_lowpass_even(N,fc) = highpass(N,fc) + lowpass(N,fc); highpass_minus_lowpass_even(N,fc) = highpass(N,fc) - lowpass(N,fc); // FIXME: Rewrite the following, as for orders 3 and 5 above, // to eliminate pole-zero cancellations: highpass_plus_lowpass_odd(N,fc) = highpass(N,fc) + lowpass(N,fc); highpass_minus_lowpass_odd(N,fc) = highpass(N,fc) - lowpass(N,fc); -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Sat, 26 Jul 2014 07:26:11 -0700, Mauritz Jameson wrote:

> I have been given a problem to solve, but I'm having a hard time > understanding the syntax and thus also how I'm supposed to solve the > problem. > > The problem is stated here: > > http://wikisend.com/download/255078/faust.zip > > I'm hoping that there's a Faust expert in this group who could take a > look at it and tell me what this is all about. > > > Thanks
Here is the homework problem that the OP is asking for help on: Delay-Equalizing Allpass Filters Please implement 7th and 9th order delay-equalizing allpass filters by extending the following code. In particular, the 3rd and 5th order filters have already been implemented in the code. Using those as a base model, please implement 7th and 9th order. Look for the words &#147;FIXME&#148; below to see where to work on this. //========== Special Filter-Bank Delay-Equalizing Allpass Filters =========== // // These special allpass filters are needed by filterbank et al. below. // They are equivalent to (lowpass(N,fc) +|- highpass(N,fc))/2, but with // canceling pole-zero pairs removed (which occurs for odd N). //-------------------- lowpass_plus|minus_highpass ------------------ highpass_plus_lowpass(1,fc) = _; highpass_plus_lowpass(3,fc) = tf2s(1,-1,1,1,1,w1) with { w1 = 2*PI*fc; }; highpass_minus_lowpass(3,fc) = tf1s(-1,1,1,w1) with { w1 = 2*PI*fc; }; highpass_plus_lowpass(5,fc) = tf2s(1,-a11,1,a11,1,w1) with { a11 = 1.618033988749895; w1 = 2*PI*fc; }; highpass_minus_lowpass(5,fc) = tf1s(1,-1,1,w1) : tf2s(1,-a12,1,a12,1,w1) with { a12 = 0.618033988749895; w1 = 2*PI*fc; }; // Catch-all definitions for generality - even order is done: highpass_plus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with { switch_odd_even(0,N,fc) = highpass_plus_lowpass_even(N,fc); switch_odd_even(1,N,fc) = highpass_plus_lowpass_odd(N,fc); }; highpass_minus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with { switch_odd_even(0,N,fc) = highpass_minus_lowpass_even(N,fc); switch_odd_even(1,N,fc) = highpass_minus_lowpass_odd(N,fc); }; highpass_plus_lowpass_even(N,fc) = highpass(N,fc) + lowpass(N,fc); highpass_minus_lowpass_even(N,fc) = highpass(N,fc) - lowpass(N,fc); // FIXME: Rewrite the following, as for orders 3 and 5 above, // to eliminate pole-zero cancellations: highpass_plus_lowpass_odd(N,fc) = highpass(N,fc) + lowpass(N,fc); highpass_minus_lowpass_odd(N,fc) = highpass(N,fc) - lowpass(N,fc); -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On Sat, 26 Jul 2014 15:05:29 -0500, Tim Wescott wrote:

> On Sat, 26 Jul 2014 07:26:11 -0700, Mauritz Jameson wrote: > >> I have been given a problem to solve, but I'm having a hard time >> understanding the syntax and thus also how I'm supposed to solve the >> problem. >> >> The problem is stated here: >> >> http://wikisend.com/download/255078/faust.zip >> >> I'm hoping that there's a Faust expert in this group who could take a >> look at it and tell me what this is all about. >> >> >> Thanks > > Here is the homework problem that the OP is asking for help on: > > Delay-Equalizing Allpass Filters > > > Please implement 7th and 9th order delay-equalizing allpass filters by > extending the following code. > In particular, the 3rd and 5th order filters have already been > implemented in the code. > Using those as a base model, please implement 7th and 9th order. > > Look for the words &#147;FIXME&#148; below to see where to work on this. > > > > //========== Special Filter-Bank Delay-Equalizing Allpass Filters > =========== > // > // These special allpass filters are needed by filterbank et al. below. > // They are equivalent to (lowpass(N,fc) +|- highpass(N,fc))/2, but with > // canceling pole-zero pairs removed (which occurs for odd N). > //-------------------- lowpass_plus|minus_highpass ------------------ > > > > highpass_plus_lowpass(1,fc) = _; > > highpass_plus_lowpass(3,fc) = tf2s(1,-1,1,1,1,w1) with { w1 = 2*PI*fc; > }; > > highpass_minus_lowpass(3,fc) = tf1s(-1,1,1,w1) with { w1 = 2*PI*fc; }; > > highpass_plus_lowpass(5,fc) = tf2s(1,-a11,1,a11,1,w1) > > with { > a11 = 1.618033988749895; > w1 = 2*PI*fc; > }; > > highpass_minus_lowpass(5,fc) = tf1s(1,-1,1,w1) : tf2s(1,-a12,1,a12,1,w1) > with { > a12 = 0.618033988749895; > w1 = 2*PI*fc; > }; > > // Catch-all definitions for generality - even order is done: > highpass_plus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with { > switch_odd_even(0,N,fc) = highpass_plus_lowpass_even(N,fc); > switch_odd_even(1,N,fc) = highpass_plus_lowpass_odd(N,fc); > }; > > highpass_minus_lowpass(N,fc) = switch_odd_even(N%2,N,fc) with { > switch_odd_even(0,N,fc) = highpass_minus_lowpass_even(N,fc); > switch_odd_even(1,N,fc) = highpass_minus_lowpass_odd(N,fc); > }; > > highpass_plus_lowpass_even(N,fc) = highpass(N,fc) + lowpass(N,fc); > highpass_minus_lowpass_even(N,fc) = highpass(N,fc) - lowpass(N,fc); > > // FIXME: Rewrite the following, as for orders 3 and 5 above, > // to eliminate pole-zero cancellations: > highpass_plus_lowpass_odd(N,fc) = highpass(N,fc) + lowpass(N,fc); > highpass_minus_lowpass_odd(N,fc) = highpass(N,fc) - lowpass(N,fc);
First, it will help your hit rate on this sort of thing if you SAY that it's a homework problem. Asking that you want help, and not a solution on a platter, is about the only thing that's saving you with me. If it's for work, then you need to explain to us why it's written like a homework problem. We get students trying to get us to do their homework for them all the time, and for the most part we don't do that. Why? Because if you want to be a competent engineer, then we'll do you a disservice by handing you the answer. And if you just want to pass your classes so that you can become a manager -- well, we don't want to work for you, ever. Is your problem with the method, or with Faust, or what? It appears to me that the solution to your problem hinges on (a) knowing Faust, (b) knowing what the various system calls are, and (c) knowing the actual transfer function math that you're being asked to apply. Which of a, b, and c are you having trouble with? Finally, if this is for a class -- why haven't you been presented with this material? If this is for a graduate seminar or individual work for a professor (or your boss), then have you gotten yourself all the available material on Faust and started reading up? -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
>First, it will help your hit rate on this sort of thing if you SAY that >it's a homework problem.
It's not. It's for work. The problem was written up by a professor, so I guess that's why it's written the way it is. I'm not looking for a solution. Just some help interpreting the problem, because I'm not familiar with Faust syntax. I've looked up the Faust manual, but that didn't get me anywhere. So I'm looking for somebody who would be kind enough to help me interpret the problem and 'translate' it into layman's terms or at least something that doesn't require the need to study the Faust manual.
On Sat, 26 Jul 2014 14:35:10 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>On Sat, 26 Jul 2014 07:26:11 -0700 (PDT), Mauritz Jameson ><mjames2393@gmail.com> wrote: > >>I have been given a problem to solve, but I'm having a hard time understanding the syntax and thus also how I'm supposed to solve the problem. >> >>The problem is stated here: >> >>http://wikisend.com/download/255078/faust.zip >> >>I'm hoping that there's a Faust expert in this group who could take a look at it and tell me what this is all about. >> >> >>Thanks > >Security-conscious people will generally not open a zip file that's >not from a trusted source (for what are hopefully obvious reasons). >You may get more interest by posting it plainly. > >
Even a .zip file containing a virus or whatever, you still have to run the executable inside of it to have a problem. If it's .txt, then it is going to be interpreted as such so you could just view it as text. But if just text, then could be simply posted as text of course, just because... boB K7IQ
>Eric Jacobsen >Anchor Hill Communications >http://www.anchorhill.com
Mauritz Jameson wrote:
>> First, it will help your hit rate on this sort of thing if you SAY that >> it's a homework problem. > > It's not. It's for work. The problem was written up by a professor, so > I guess that's why it's written the way it is. I'm not looking for a solution. > Just some help interpreting the problem, because I'm not familiar with > Faust syntax. I've looked up the Faust manual, but that didn't get > me anywhere. > > So I'm looking for somebody who would be kind enough to help me interpret the problem and > 'translate' it into layman's terms or at least something that doesn't require > the need to study the Faust manual. >
www.google.com/search?q=Faust+syntax+tutorial !!!!!