Discussion:
[music-dsp] Andrew Simper's State Variable Filter
Russell Borogove
2002-06-22 22:56:20 UTC
Permalink
I have naive filter questions.

I've been using a Chamberlin state-variable filter in my VST
plugins for several months, and have occasionally been bitten
by the instability at (not all that high) frequencies that the filter
exhibits.

In the MusicDSP code archive, I see Andrew Simper's double-
sampled stable version of the filter, but looking at the calculation
of the freq term:

freq = MIN(0.25, 2.0*sin(PI*fc/(fs*2))); // the fs*2 is because it's
double sampled

...it seems to me that because of the MIN, it won't be adjustable
above about:

freq = 0.25 = 2.0*sin( PI * fc / (fs*2) )
0.125 = sin( PI * fc / (fs*2) )
arcsin( 0.125 ) = PI * fc / (fs * 2)
0.1253278 = PI * fc/(fs*2)
0.03989 = fc / (fs * 2)
fc = fs * 0.07978

...or ~3.5KHz for a Fs of 44100Hz. I suppose that's one way to make
sure the code doesn't do anything weird at high Fc! Fc doesn't seem
to be used anywhere else in the calculation. Am I interpreting this
correctly? What's the deal here?

I tried a naive approach to extending the stable range of the
Chamberlin SVF: Upsampling the input 4:1 with linear interpolation,
running it through 4 iterations of the SVF with Fs 4 times normal,
and averaging the output over those iterations, and it added more
noise than even my tin ear found acceptable. Is it worth trying this
technique with a higher-order interpolation, or is it fundamentally
a bad way to go?

-Russell B


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Nigel Redmon
2002-06-23 00:38:28 UTC
Permalink
I didn't look at the code, but I think it's pretty safe to assume: The idea is
to run the filter twice but only keep one output--cheap oversampling and
decimation. So, the usable frequency range is doubled, not halved. There are
some subtleties because of the Q feedback, giving a little interaction and
changing the limits, but as a rough look you can see that with this filter you
have trouble if the two frequency-controlling multipliers in the loop become
greater than 1. So, oversampling lets you drop to a lower frequency, which
lowers those multipliers.

Sorry, don't have time to look at the code at the moment--I assume freq is the
multiplier, and I'm not sure why the 0.25 limit offhand... but like I said, I'm
sure the filter is run twice in the loop with the first output dropped, so you
get double the range. You should get something like 14 kHz of useable range.
Post by Russell Borogove
I have naive filter questions.
I've been using a Chamberlin state-variable filter in my VST
plugins for several months, and have occasionally been bitten
by the instability at (not all that high) frequencies that the filter
exhibits.
In the MusicDSP code archive, I see Andrew Simper's double-
sampled stable version of the filter, but looking at the calculation
freq = MIN(0.25, 2.0*sin(PI*fc/(fs*2))); // the fs*2 is because it's
double sampled
...it seems to me that because of the MIN, it won't be adjustable
freq = 0.25 = 2.0*sin( PI * fc / (fs*2) )
0.125 = sin( PI * fc / (fs*2) )
arcsin( 0.125 ) = PI * fc / (fs * 2)
0.1253278 = PI * fc/(fs*2)
0.03989 = fc / (fs * 2)
fc = fs * 0.07978
...or ~3.5KHz for a Fs of 44100Hz. I suppose that's one way to make
sure the code doesn't do anything weird at high Fc! Fc doesn't seem
to be used anywhere else in the calculation. Am I interpreting this
correctly? What's the deal here?
I tried a naive approach to extending the stable range of the
Chamberlin SVF: Upsampling the input 4:1 with linear interpolation,
running it through 4 iterations of the SVF with Fs 4 times normal,
and averaging the output over those iterations, and it added more
noise than even my tin ear found acceptable. Is it worth trying this
technique with a higher-order interpolation, or is it fundamentally
a bad way to go?
-Russell B
dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Jon Watte
2002-06-23 00:42:04 UTC
Permalink
Post by Russell Borogove
I tried a naive approach to extending the stable range of the
Chamberlin SVF: Upsampling the input 4:1 with linear interpolation,
running it through 4 iterations of the SVF with Fs 4 times normal,
and averaging the output over those iterations, and it added more
Because you know the input is band limited and your processing
doesn't add harmonics (if anything, it removes them :-), you
don't need to do anything special to decimate. Just throw away
3 out of 4 samples on the way down.

To up-sample, you might want to try the trusty favorite "cubic
Hermite" interpolator found on the music-dsp source code archive.
It provides reasonable noise-less-ness (compared to linear, which
is fairly noisy!) and low computational impact.

Cheers,

/ h+


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-23 01:19:18 UTC
Permalink
Post by Jon Watte
Because you know the input is band limited and your processing
doesn't add harmonics (if anything, it removes them :-), you
don't need to do anything special to decimate. Just throw away
3 out of 4 samples on the way down.
I tried that also, still noisy. Maybe I'll go back to the drawing
board and see if I did something stupid.
Post by Jon Watte
To up-sample, you might want to try the trusty favorite "cubic
Hermite" interpolator found on the music-dsp source code archive.
It provides reasonable noise-less-ness (compared to linear, which
is fairly noisy!) and low computational impact.
I was hearing noise through crappy laptop speakers with linear
interpolation on a 440Hz sine, which really surprised me (my
hearing is _not_ that good). Again, I suspect my code isn't really
doing what I think it is.

-R



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Jon Watte
2002-06-23 03:06:47 UTC
Permalink
Post by Russell Borogove
Post by Jon Watte
don't need to do anything special to decimate. Just throw away
3 out of 4 samples on the way down.
I tried that also, still noisy. Maybe I'll go back to the drawing
board and see if I did something stupid.
The noise is probably introduced by the linear interpolator going
in, so anything you improve after that stage won't help.
Post by Russell Borogove
I was hearing noise through crappy laptop speakers with linear
interpolation on a 440Hz sine, which really surprised me (my
hearing is _not_ that good). Again, I suspect my code isn't really
doing what I think it is.
Well, assuming you got the direction of interpolation right (you'd
be surprised how often I get it turned around and hear sawtooth
stairstepping :-) then linear interpolation may add noise as high
as -40 dB below your signal peak, which might be hearable on a
laptop speaker. Especially on a pure sine wave.

Cheers,

/ h+


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-23 18:09:07 UTC
Permalink
Post by Jon Watte
Well, assuming you got the direction of interpolation right (you'd
be surprised how often I get it turned around and hear sawtooth
stairstepping :-) then linear interpolation may add noise as high
as -40 dB below your signal peak, which might be hearable on a
laptop speaker. Especially on a pure sine wave.
I wouldn't be a bit surprised -- the slope of the blend terms really
does feel counter-intuitive. :)

I think I need a little quick-and-dirty graphing/oscilloscope system in
my plugin libraries. So often, running a test case through my code,
then looking at the waveform in Cool Edit, makes it blindingly clear
what I did wrong.

I'll try to tackle my filters again on Monday.

-RB



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Bram De Jong
2002-06-23 06:23:16 UTC
Permalink
Post by Jon Watte
Well, assuming you got the direction of interpolation right (you'd
be surprised how often I get it turned around and hear sawtooth
stairstepping :-) then linear interpolation may add noise as high
as -40 dB below your signal peak, which might be hearable on a
laptop speaker. Especially on a pure sine wave.
Especialy with delays this is SO funny.
I've been know to talk to myself while coding:

"OK, the delay goes *that* way,
the samples *that* way, errrrmmmmmmm, wait, wait, I know I'm gonna get it
right, BZZZZZZZZZZZZZZZZZZZ, nooooooooooooooooooooooooo"

;-)


- bram


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
andrew simper
2002-06-23 17:42:54 UTC
Permalink
My fault, I put the MIN in the wrong place when re-typing the code to submit
it to the archive.

freq = 2.0*sin(PI*MIN(0.25, fc/(fs*2)));

or equivalently (for those that didn't understand the 0.25):

freq = 2.0*sin(PI*0.5*MIN(0.5, fc/fs));

Thanks for picking up the error, and everyone else who has used it and
didn't notice, well at least someone was paying attention ;)

For stability you just have to increase your resonance. This is taken
account of in the calculation:

damp = MIN(2.0*(1.0 - pow(res, 0.25)), MIN(2.0, 2.0/freq - freq*0.5));

which descreases damping (increase resonance) with increased frequency.

Others prefer to limit your frequency depending on damping, but I prefer to
have a wide frequency range.

--andy

----- Original Message -----
From: "Russell Borogove" <***@estarcion.com>
To: <music-***@shoko.calarts.edu>
Sent: Sunday, June 23, 2002 6:56 AM
Subject: [music-dsp] Andrew Simper's State Variable Filter
Post by Russell Borogove
freq = MIN(0.25, 2.0*sin(PI*fc/(fs*2))); // the fs*2 is because it's
double sampled
...or ~3.5KHz for a Fs of 44100Hz. I suppose that's one way to make
dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-23 18:00:42 UTC
Permalink
Post by andrew simper
My fault, I put the MIN in the wrong place when re-typing the code to submit
it to the archive.
freq = 2.0*sin(PI*MIN(0.25, fc/(fs*2)));
freq = 2.0*sin(PI*0.5*MIN(0.5, fc/fs));
Thanks for picking up the error, and everyone else who has used it and
didn't notice, well at least someone was paying attention ;)
Ahh, thank you, *that* makes perfect sense.

Can Bram or someone make sure this gets fixed in the archive
before too many people go implementing the wrong thing?

-Russell B



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Jon Watte
2002-06-23 19:26:15 UTC
Permalink
To be really clear:

Linear Interpolation done WRONG will add noise at about the same
level as your signal.

Linear Interpolation done RIGHT will add noise 40 dB below your
signal, which is still quite noticeable with "pure" signals, such
as sine waves.

Cheers,

/ h+
-----Original Message-----
Sent: Sunday, June 23, 2002 11:09 AM
Subject: Re: [music-dsp] Andrew Simper's State Variable Filter
Post by Jon Watte
Well, assuming you got the direction of interpolation right (you'd
be surprised how often I get it turned around and hear sawtooth
stairstepping :-) then linear interpolation may add noise as high
as -40 dB below your signal peak, which might be hearable on a
laptop speaker. Especially on a pure sine wave.
I wouldn't be a bit surprised -- the slope of the blend terms really
does feel counter-intuitive. :)
I think I need a little quick-and-dirty graphing/oscilloscope system in
my plugin libraries. So often, running a test case through my code,
then looking at the waveform in Cool Edit, makes it blindingly clear
what I did wrong.
I'll try to tackle my filters again on Monday.
-RB
dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Sampo Syreeni
2002-06-23 19:52:07 UTC
Permalink
Linear Interpolation done RIGHT will add noise 40 dB below your signal,
which is still quite noticeable with "pure" signals, such as sine waves.
Of course, that's compared to the nicest of excellent interpolations, sinc
with an infinitely long convolution kernel (or the common variant, pure
1-1 playback). Compared to zeroth order, it's, well, far less.

Sampo Syreeni, aka decoy - mailto:***@iki.fi, tel:+358-50-5756111
student/math+cs/helsinki university, http://www.iki.fi/~decoy/front
openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Jon Watte
2002-06-24 00:14:02 UTC
Permalink
Post by Sampo Syreeni
Of course, that's compared to the nicest of excellent interpolations, sinc
with an infinitely long convolution kernel (or the common variant, pure
1-1 playback). Compared to zeroth order, it's, well, far less.
Zeroth order interpolation, when done RIGHT, will add noise at about
20 dB below your main signal, which is quite noticeable even on the
built-in piezo beeper of any motherboard :-)

Cheers,

/ h+


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-24 02:15:35 UTC
Permalink
Post by Jon Watte
Zeroth order interpolation, when done RIGHT, will add noise at about
20 dB below your main signal, which is quite noticeable even on the
built-in piezo beeper of any motherboard :-)
Is there a right and wrong way to do zeroth-order interpolation? :)


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Bram De Jong
2002-06-24 07:44:21 UTC
Permalink
Post by Russell Borogove
Can Bram or someone make sure this gets fixed in the archive
before too many people go implementing the wrong thing?
Hehehe :-)
There's only me on the archive.
David just helped me a bit in building the php 'framework' ;-)

BTW: if anyone feels like adding anything to the archive -structure wise,
not data-wise- feel free to help me out ;-))

I'll update the post.


- bram


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Sampo Syreeni
2002-06-24 08:25:42 UTC
Permalink
Post by Russell Borogove
Is there a right and wrong way to do zeroth-order interpolation? :)
Yes. The wrong way would be to truncate your wavetable pointer instead of
rounding it.

Sampo Syreeni, aka decoy - mailto:***@iki.fi, tel:+358-50-5756111
student/math+cs/helsinki university, http://www.iki.fi/~decoy/front
openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Laurent de Soras [Ohm Force]
2002-06-24 08:50:15 UTC
Permalink
Post by Sampo Syreeni
Post by Russell Borogove
Is there a right and wrong way to do zeroth-order interpolation? :)
Yes. The wrong way would be to truncate your wavetable pointer instead of
rounding it.
I don't think so. truncate (x) == round (x - 0.5) for x >= 0
The difference is therefore just a half sample delay. I don't
know if it's really wrong.

-- Laurent

==================================+========================
Laurent de Soras | Ohm Force
DSP developer & Software designer | Digital Audio Software
mailto:***@ohmforce.com | http://www.ohmforce.com
==================================+========================

dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Pavel Savygin
2002-06-24 09:51:01 UTC
Permalink
Hello All,

I have periodic signal. Exactly to say, voice recorded from cheap
microphone.

That means that original signal is passing thru mic and only then
to soundcard. So, because mic is cheap, we can consider it like
nonlinear unit. And nonlinearity has assymetrical law. Also its
frequency response is also non-linear and is like :

A,db
^
| /----------------\
| / \
| / \
| / \
|/ \
+-----------------------------------> f
200 hz 2000 Hz


Also there are some noise.

Non-linearity also causes some noise.

So, end signal cosist of : pink noise + non-linearity noise +
original signal


So, if I have signal with base freq 100 and some harmonics at 200
, 300, then peak is sometimes at 200 or 300 or sometimes in much
more diffrent place, so, it is not easy to define even exact bin
of FFT to make rough estimation of base freq.

Does somebody know common ways of looking for fundamental
frequency of periodic signal with noise?
--
Best regards,
Pavel mailto:***@vpi-minsk.com


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-24 15:49:09 UTC
Permalink
Post by Sampo Syreeni
Post by Russell Borogove
Is there a right and wrong way to do zeroth-order interpolation? :)
Yes. The wrong way would be to truncate your wavetable pointer instead of
rounding it.
Does that do anything worse than give you a half-sample phase shift?

-RB



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Sampo Syreeni
2002-06-24 11:21:01 UTC
Permalink
I don't think so. truncate (x) == round (x - 0.5) for x >= 0 The
difference is therefore just a half sample delay.
Like truncating your sample values simply gives you a 0.5 grid point
constant bias? While f(truncate(x))=f(round(x-0.5)), it certainly isn't
equal to f(round(x)-0.5), which would be the proper 0.5 sampling time
delay.

Under the (heavy) assumption that the resampling ratio is a normal
irrational, the mean absolute error in the offsets you get by truncating
is twice what you'd get via rounding. While you're right about the delay,
it isn't all that is happening as the variance of our phase jitter is now
more than it used to be. That translates to something like a 6dB
improvement in S/N when rounding properly. Under less ideal conditions,
the phase error signal will not be white, and we bump into all sorts of
complications in deriving the mean error. The classic reference for
sinusoids is Moore: "Table Lookup Noise for Sinusoidal Digital
Oscillators," Computer Music Journal, volume 1, issue 2 (April 1977), pp.
26-29.

All of this is academic, of course. No sane person uses zeroth order
interpolation, anymore, thanks to the day's abundance of processing
cycles.

Sampo Syreeni, aka decoy - mailto:***@iki.fi, tel:+358-50-5756111
student/math+cs/helsinki university, http://www.iki.fi/~decoy/front
openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Laurent de Soras [Ohm Force]
2002-06-24 11:53:00 UTC
Permalink
Post by Sampo Syreeni
it isn't all that is happening as the variance of our phase jitter is now
more than it used to be. That translates to something like a 6dB
improvement in S/N when rounding properly.
Ah yes you're right

-- Laurent

==================================+========================
Laurent de Soras | Ohm Force
DSP developer & Software designer | Digital Audio Software
mailto:***@ohmforce.com | http://www.ohmforce.com
==================================+========================

dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Jaeho Chang
2002-06-24 12:07:43 UTC
Permalink
I'm not an expert in acousitcs,
but a fundamental frequency of sound has nothing to do with
one peak frequency of the spectrum.

Rather, the difference between peaks are the key.
If you have 100, 200, 300 Hz freq peaks, then the fundamental
frequency is 100 Hz.
Even if you have 200, 300, 400, but no 100 at all,
the fundamental is still 100Hz.

If your signal contains too much noise,
it might be better to use cepstrum analysis.

Hope to hear a better explanation from an expert ;-)

Jaeho
Post by Pavel Savygin
Hello All,
I have periodic signal. Exactly to say, voice recorded from cheap
microphone.
That means that original signal is passing thru mic and only then
to soundcard. So, because mic is cheap, we can consider it like
nonlinear unit. And nonlinearity has assymetrical law. Also its
A,db
^
| /----------------\
| / \
| / \
| / \
|/ \
+-----------------------------------> f
200 hz 2000 Hz
Also there are some noise.
Non-linearity also causes some noise.
So, end signal cosist of : pink noise + non-linearity noise +
original signal
So, if I have signal with base freq 100 and some harmonics at 200
, 300, then peak is sometimes at 200 or 300 or sometimes in much
more diffrent place, so, it is not easy to define even exact bin
of FFT to make rough estimation of base freq.
Does somebody know common ways of looking for fundamental
frequency of periodic signal with noise?
--
Best regards,
dupswapdrop -- the music-dsp mailing list and website: subscription
info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Pavel Savygin
2002-06-25 07:18:30 UTC
Permalink
Hello Jaeho,

Monday, June 24, 2002, 3:07:43 PM, you wrote:

JC> I'm not an expert in acousitcs,
JC> but a fundamental frequency of sound has nothing to do with
JC> one peak frequency of the spectrum.

JC> Rather, the difference between peaks are the key.
JC> If you have 100, 200, 300 Hz freq peaks, then the fundamental
JC> frequency is 100 Hz.
JC> Even if you have 200, 300, 400, but no 100 at all,
JC> the fundamental is still 100Hz.

Ok, may be you know how to define peak?

JC> If your signal contains too much noise,
JC> it might be better to use cepstrum analysis.

As I know cepstrum is smoothing peaks:((. But may be I'm wrong.

JC> Hope to hear a better explanation from an expert ;-)
--
Best regards,
Pavel mailto:***@vpi-minsk.com
-


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-24 22:51:19 UTC
Permalink
With Andrew's correction to the double sampled SVF algorithm, I
was able to get things working nicely. The conditionals and pow()
in the calculation of the damping term turn out to be expensive if
you change Fc and/or resonance on every sample, which my
application does (whether that's a reasonable thing to do is a
different question entirely). In that case, you can speed things up
a bit by avoiding the limiting calculation on the damping term and
going to a 4x oversampling on the traditional Chamberlin SVF.
The caller is responsible for guaranteeing Fc < Fs/2; this seems to be
stable for any resonance in the 0.0-1.0 range.

As for my question about noise in the 4x oversampled version, I don't
know what I was hearing the first time around, maybe the steel plate
in my skull was resonating. According to Cool Edit's freq analysis, it
seems like the noise floor for both the 2x and 4x with _no_ interpolation
is down below -90dB for an 800Hz sine. That doesn't really fit with the
worst-case numbers people were tossing out here earlier, so I'm not
sure what I'm misunderstanding this week. :) Still, little by little things
become clearer...


-RB



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Russell Borogove
2002-06-25 06:24:20 UTC
Permalink
Sorry for the self-reply; I just love sharing my little coding dramas
with everyone here.
Post by Russell Borogove
As for my question about noise in the 4x oversampled version, I don't
know what I was hearing the first time around, maybe the steel plate
in my skull was resonating.
This turned out to be me using the same filter state structure for
two independent channels -- it essentially wound up dropping
every other block of processed output. Yeah, no wonder it
sounded harsh. Again, it was obvious what the problem was
once I looked at the output waveform and saw big jumps every
256 samples.

-RB



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
andrew simper
2002-06-25 06:41:00 UTC
Permalink
Post by Russell Borogove
With Andrew's correction to the double sampled SVF algorithm, I
was able to get things working nicely. The conditionals and pow()
in the calculation of the damping term turn out to be expensive if
you change Fc and/or resonance on every sample,
I didn't actually expect people to call pow() and sin() every sample, it's
just a starting point ;) I use table lookups for this, although if you don't
need exact tuning you could use a polynomial approximation of sin(). There
are lots of alternatives. Unless you can come up with a really quick way of
calculating power(2.0, x) then your stuck with a table to get your fc anyway
so just roll them all into a single table lookup.
Post by Russell Borogove
seems like the noise floor for both the 2x and 4x with _no_ interpolation
is down below -90dB for an 800Hz sine. That doesn't really fit with the
What are you interpolating? Perhaps you are getting confused with the other
thread that span off this one that had the same title?

andy


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Christer Ahlström
2002-06-25 06:45:57 UTC
Permalink
Hi, I've looked at a number of ways to extract the fundamental frequency
from speech. A simple and quite robust method is autocorrelation. If you
have access to matlab you might want to look at:

http://www.utdallas.edu/~loizou/speech/colea.htm

They have implemented autocorrelation and cepstrum methods that works fairly
good (although not perfect, the implementation is very straight forward).

An example of a wavelet method can be found here:

http://cnmat.cnmat.berkeley.edu/~tristan/Report/Report.html

Regards
Christer Ahlström

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/
Loading...