DSPRelated.com
Forums

help with flanger effect

Started by omal...@gmail.com February 13, 2006
Hey,

I'm implementing a flanger effect as part of a guitar effects processor
on an ADSP-21364 development board.

A Flanger effect is produced by adding a single delay to the current
input sample.  The duration of this delay is determined by the
magnitude of a low frequency sin wave.

The values I am using are:

1Hz sin wave, values in a lookup table
max 3ms delay => 144 samples in delay buffer @ 48kHz

My calculation of the integer delay and circular buffer addressing seem
to be fine.

My problem is that on top of the desired output I am also getting a
'police siren' like sound which i suspect is a sin wave.  Could anyone
tell me why this might be?  I have implemented the effect using the
same tehnique in Matlab and had no problems.

Many thanks

Ronan

omalley.ronan@gmail.com wrote:
> Hey, > > I'm implementing a flanger effect as part of a guitar effects processor > on an ADSP-21364 development board. > > A Flanger effect is produced by adding a single delay to the current > input sample. The duration of this delay is determined by the > magnitude of a low frequency sin wave. > > The values I am using are: > > 1Hz sin wave, values in a lookup table > max 3ms delay => 144 samples in delay buffer @ 48kHz > > My calculation of the integer delay and circular buffer addressing seem > to be fine.
Might be clipping. Are compensating the increase in signal level? Try to take down the overall signal level before you convert to fixed-point (for sending the data to the DAC) by a factor of 0.5 or so.
On 13 Feb 2006 05:02:21 -0800, "omalley.ronan@gmail.com"
<omalley.ronan@gmail.com> wrote:

>Hey, > >I'm implementing a flanger effect as part of a guitar effects processor >on an ADSP-21364 development board. > >A Flanger effect is produced by adding a single delay to the current >input sample. The duration of this delay is determined by the >magnitude of a low frequency sin wave. > >The values I am using are: > >1Hz sin wave, values in a lookup table >max 3ms delay => 144 samples in delay buffer @ 48kHz > >My calculation of the integer delay and circular buffer addressing seem >to be fine. > >My problem is that on top of the desired output I am also getting a >'police siren' like sound which i suspect is a sin wave. Could anyone >tell me why this might be? I have implemented the effect using the >same tehnique in Matlab and had no problems.
Does your variable length delay line only allow an integer number of samples delay, or is the resolution finer than that? Allan
I'm pretty sure it's not clipping, i have taken the signal down in
level.

I am only allowing an integer number of sample delays, would it be
worth using a higher resolution that that? I thought about using linear
interpolation, but when I programmed the effect in Matlab using integer
sample delays it sounded fine.

omalley.ronan@gmail.com wrote:
> I'm pretty sure it's not clipping, i have taken the signal down in > level. > > I am only allowing an integer number of sample delays, would it be > worth using a higher resolution that that? I thought about using linear > interpolation, but when I programmed the effect in Matlab using integer > sample delays it sounded fine.
I was guessing that the "police siren" was caused by the small jumps when you switch from one tap in your delay line to the next. You need interpolation to make smaller steps, but you should avoid linear interpolation for audio unless the sampling frequency is very high. (Most interpolation problems become easier if the highest frequency is small wrt the sampling frequency.) "Normal" sampling frequencies require the use of cleverer interpolation. I'm sure one of the other comp.dsp regulars can help you with that. Regards, Allan
thanks very much Allan, I'll look into some interpolation algorithms
suitable for audio.

<allanherriman@hotmail.com> wrote in message 
news:1139912958.965452.109950@o13g2000cwo.googlegroups.com...
> omalley.ronan@gmail.com wrote: >> I'm pretty sure it's not clipping, i have taken the signal down in >> level. >> >> I am only allowing an integer number of sample delays, would it be >> worth using a higher resolution that that? I thought about using linear >> interpolation, but when I programmed the effect in Matlab using integer >> sample delays it sounded fine. > > I was guessing that the "police siren" was caused by the small jumps > when you switch from one tap in your delay line to the next. > > You need interpolation to make smaller steps, but you should avoid > linear interpolation for audio unless the sampling frequency is very > high. (Most interpolation problems become easier if the highest > frequency is small wrt the sampling frequency.) > "Normal" sampling frequencies require the use of cleverer > interpolation. I'm sure one of the other comp.dsp regulars can help > you with that.
If it is just for a guitar effect and the sampling rate is decently high (like 44.1 or 48kHz), you can probably get away with linear interpolation. Electric guitars tend not to have too much high frequency content. But in general I agree with Allan. -- Jon Harris SPAM blocker in place: Remove 99 (but leave 7) to reply
I am sampling at 48kHz.  I implemented linear interpolation and it did
help, but the background noise is still there.  I then proceeded to
implement a 4-point cubic interpolation equation and the sound is still
there!  I am using a very high resolution sin wave lookup table, so I
can't figure out why this didn't solve it!!

On 16 Feb 2006 02:46:38 -0800, "omalley.ronan@gmail.com"
<omalley.ronan@gmail.com> wrote:

>I am sampling at 48kHz. I implemented linear interpolation and it did >help, but the background noise is still there. I then proceeded to >implement a 4-point cubic interpolation equation and the sound is still >there! I am using a very high resolution sin wave lookup table, so I >can't figure out why this didn't solve it!!
One likely reason is that my guess was wrong. How about you convert the output of your flanger to a short MP3 and put it on the web somewhere (and post a link to it in this thread). Someone may recognise the sound, and come up with a better guess than mine. Regards, Allan
On Thu, 16 Feb 2006 06:00:10 GMT, "Jon Harris"
<jon99_harris7@hotmail.com> wrote:

><allanherriman@hotmail.com> wrote in message >news:1139912958.965452.109950@o13g2000cwo.googlegroups.com... >> omalley.ronan@gmail.com wrote: >>> I'm pretty sure it's not clipping, i have taken the signal down in >>> level. >>> >>> I am only allowing an integer number of sample delays, would it be >>> worth using a higher resolution that that? I thought about using linear >>> interpolation, but when I programmed the effect in Matlab using integer >>> sample delays it sounded fine. >> >> I was guessing that the "police siren" was caused by the small jumps >> when you switch from one tap in your delay line to the next. >> >> You need interpolation to make smaller steps, but you should avoid >> linear interpolation for audio unless the sampling frequency is very >> high. (Most interpolation problems become easier if the highest >> frequency is small wrt the sampling frequency.) >> "Normal" sampling frequencies require the use of cleverer >> interpolation. I'm sure one of the other comp.dsp regulars can help >> you with that. > >If it is just for a guitar effect and the sampling rate is decently high (like >44.1 or 48kHz), you can probably get away with linear interpolation. Electric >guitars tend not to have too much high frequency content. But in general I >agree with Allan.
My Fender Jaguar has 1M ohm pots. At the half way mark, the output resistance of the guitar is just over 250k ohm. What's the equivalent (lumped) capacitance of a guitar lead? A few hundred pF? That would give a cutoff frequency of a few kHz. Regards, Allan