hey pd,
i'm trying to do feed forward in pd. i think i'm tired and not thinking this through...
so, i have a [blackbox~] that does stuff to the audio. it uses feedback internally and is currently a bit unstable. can i make it more stable by going like this:
[...] [r~ fb]
| |
| [*~ -0.1]
| ______/
|/
[blackbox~]
|______
|
| [s~ fb]
|
[...]
is there some funky combination of delays i can achieve this? i get the feeling this only works in analog electronics because you can say that on some level everything happens at exactly the same time - the delays inherent in digital systems mean that this doesn't work...
what alternative DSP techniques are there for damping unstable feedback loops?
thanks d
Yeah, this has been covered here before. Look up "DSP loops" in the archives. In short, you can't ask a subpatch/abstraction/whatever to compute output based on it's input simultaneously. Unlike analog electronics, where electrons move almost simultaneously, in DSP it's logically impossible. So your feedback loop must contain a one block delay. [send] and [receive] do that.
However, if your problems are with something like a delay line or filter inside [blackbox~] saturating and "blowing up", then you might look at some kind of limiter, waveshaper or clipper to keep the incoming audio within certain limits.
HTH, d.
Damian Stewart wrote:
hey pd,
i'm trying to do feed forward in pd. i think i'm tired and not thinking this through...
so, i have a [blackbox~] that does stuff to the audio. it uses feedback internally and is currently a bit unstable. can i make it more stable by going like this:
[...] [r~ fb] | | | [*~ -0.1] | ______/ |/ [blackbox~] |______ |
| [s~ fb] | [...]is there some funky combination of delays i can achieve this? i get the feeling this only works in analog electronics because you can say that on some level everything happens at exactly the same time - the delays inherent in digital systems mean that this doesn't work...
what alternative DSP techniques are there for damping unstable feedback loops?
thanks d
What does blackbox~ do? Is it linear?
On Mon, Sep 15, 2008 at 3:18 PM, Damian Stewart damian@frey.co.nz wrote:
hey pd,
i'm trying to do feed forward in pd. i think i'm tired and not thinking this through...
so, i have a [blackbox~] that does stuff to the audio. it uses feedback internally and is currently a bit unstable. can i make it more stable by going like this:
[...] [r~ fb] | | | [*~ -0.1] | ______/ |/ [blackbox~] |______ |
| [s~ fb] | [...]is there some funky combination of delays i can achieve this? i get the feeling this only works in analog electronics because you can say that on some level everything happens at exactly the same time - the delays inherent in digital systems mean that this doesn't work...
what alternative DSP techniques are there for damping unstable feedback loops?
thanks d
-- damian stewart | skype: damiansnz | damian@frey.co.nz frey | live art with machines | http://www.frey.co.nz
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
i don't know what 'linear' means in this context. let's say, then, that no, it's not linear.
Charles Henry wrote:
What does blackbox~ do? Is it linear?
[...] [r~ fb] | | | [*~ -0.1] | ______/ |/ [blackbox~] |______ |
| [s~ fb] | [...]
If you're talking about the example of your controlled feedback problem, then it is linear. A linear operator, f is an operator for which f(a*x+b*y) = a*f(x) + b*f(y) a and b are scalars, x and y are signals
It's not a tough concept. It's likely different from the vernacular use of the word "linear", but it has profound implications for analysis.
Examples of linear operators are convolution, filtering, fourier transform, or matrix multiplication. Linear operators have a space of functions called eigenfunctions or eigenvectors which decompose the operator.
Chuck
On Tue, Sep 16, 2008 at 4:49 AM, Damian Stewart damian@frey.co.nz wrote:
i don't know what 'linear' means in this context. let's say, then, that no, it's not linear.
Charles Henry wrote:
What does blackbox~ do? Is it linear?
[...] [r~ fb] | | | [*~ -0.1] | ______/ |/ [blackbox~] |______ |
| [s~ fb] | [...]-- damian stewart | skype: damiansnz | damian@frey.co.nz frey | live art with machines | http://www.frey.co.nz
so, to further elaborate, i want to avoid mic->speaker->mic feedback loops.
this is for the RJDJ project that has been posted about a couple of times already (there's possibly still places in the Vienna sprint, if anyone wants to be flown to Vienna, put up in a swanky hotel, and make music with Pd for the iPhone this coming weekend; look back a week or two for the invite message).
anyway, i have a patch that implements a resonator that feeds back on itself, to turn incoming audio into some kind of big cheesy holy-angels-choir kind of chord. this works fine and dandy in theory, but i'm getting a problem sometimes when playing it on the iphone, namely that the microphone and earpieces are physically very close together on the bundled iphone headphones, so under certain conditions, nasty feedback will happen. i could apply a notch filter to that particular frequency (we already calculate the input spectral centre), but then the feedback might happen in a different place if people are using non-standard headphones/microphones. it would be nicer to have a more general feedback limiting mechanism. (this would be useful for live performance rigs, too.)
now, CPU on the device is very limited, but we are already performing an FFT on the input to use for analysis, so this data is available. i only vaguely understand how FFT works, but would it be possible to perform band-limited filtering on the input based on this data? my idea goes like this: since feedback tends to be about particular narrow-band signal peaks, could i for example square each FFT bin to exaggerate these peaks, then scale down to 10% or so, then subtract this from the incoming audio? would i do this by constructing an inverse FFT, and then subtracting the (scaled) IFFT output from the raw audio input? the aim is to reduce feedback without altering the rest of the incoming sound too much, so i don't want to base the audio on just an IFFT reconstruction of the signal (cos IFFT sounds ugly).
are FFT results guaranteed to be normalised? ie, will squaring an FFT bin always result in a lower signal level?
So, you want to walk right up to the edge of instability and back away, right? We've all been there. I wanted to do the same thing with an entire room once, and I still do. I've been working on a new adaptive filter design which I hope will have better performance.
I think for your application, the LMS adaptive filters are your best bet. I haven't used the LMS filters before, so someone else will have to comment on how to do this.
What you need to do is equalize the frequency response between loudspeaker and microphone.
Anywhere in frequency that the gain in the loop is greater than 1, causes instability. This *includes* any kind of effects that you apply in your feedback loop. You're not only going to have to know the frequency response of the loudspeaker-to-microphone transfer function, you'll have to know the frequency response of all your effects.
So, notch filtering doesn't fix the problem. Equalization and careful design of your digital effects does. Also, you should probably look into putting compression on the output--this will not stop feedback, but will prevent it from getting too loud.
Chuck
On Tue, Sep 16, 2008 at 5:08 AM, Damian Stewart damian@frey.co.nz wrote:
so, to further elaborate, i want to avoid mic->speaker->mic feedback loops.
this is for the RJDJ project that has been posted about a couple of times already (there's possibly still places in the Vienna sprint, if anyone wants to be flown to Vienna, put up in a swanky hotel, and make music with Pd for the iPhone this coming weekend; look back a week or two for the invite message).
anyway, i have a patch that implements a resonator that feeds back on itself, to turn incoming audio into some kind of big cheesy holy-angels-choir kind of chord. this works fine and dandy in theory, but i'm getting a problem sometimes when playing it on the iphone, namely that the microphone and earpieces are physically very close together on the bundled iphone headphones, so under certain conditions, nasty feedback will happen. i could apply a notch filter to that particular frequency (we already calculate the input spectral centre), but then the feedback might happen in a different place if people are using non-standard headphones/microphones. it would be nicer to have a more general feedback limiting mechanism. (this would be useful for live performance rigs, too.)
now, CPU on the device is very limited, but we are already performing an FFT on the input to use for analysis, so this data is available. i only vaguely understand how FFT works, but would it be possible to perform band-limited filtering on the input based on this data? my idea goes like this: since feedback tends to be about particular narrow-band signal peaks, could i for example square each FFT bin to exaggerate these peaks, then scale down to 10% or so, then subtract this from the incoming audio? would i do this by constructing an inverse FFT, and then subtracting the (scaled) IFFT output from the raw audio input? the aim is to reduce feedback without altering the rest of the incoming sound too much, so i don't want to base the audio on just an IFFT reconstruction of the signal (cos IFFT sounds ugly).
are FFT results guaranteed to be normalised? ie, will squaring an FFT bin always result in a lower signal level?
-- damian stewart | skype: damiansnz | damian@frey.co.nz frey | live art with machines | http://www.frey.co.nz
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue, Sep 16, 2008 at 7:34 AM, Charles Henry czhenry@gmail.com wrote:
I think for your application, the LMS adaptive filters are your best bet. I haven't used the LMS filters before, so someone else will have to comment on how to do this.
I also have a more lengthy involved method that will converge faster. I can help, but I need to know what tools you have available to work with on this project. Linux? Octave? Matlab?
Chuck
Damien you know about deconvolution?
Just record a click or whatever through the system, then in the fft-domain reverse the kernel (play it backwards). Use this to do convolution on your system. So in that sense your on the right track with your ascii diagram.
Dont know the theory behind it, but I did some experiments in pd. It seems quite efficent in som situations.
mvh/Steffen
Damian Stewart skrev:
hey pd,
i'm trying to do feed forward in pd. i think i'm tired and not thinking this through...
so, i have a [blackbox~] that does stuff to the audio. it uses feedback internally and is currently a bit unstable. can i make it more stable by going like this:
[...] [r~ fb] | | | [*~ -0.1] | ______/ |/ [blackbox~] |______ |
| [s~ fb] | [...]is there some funky combination of delays i can achieve this? i get the feeling this only works in analog electronics because you can say that on some level everything happens at exactly the same time - the delays inherent in digital systems mean that this doesn't work...
what alternative DSP techniques are there for damping unstable feedback loops?
thanks d