DSPRelated.com
Forums

How to make filter like this for stereo expansion

Started by jungledmnc October 6, 2012
Hi,

I want to create filter with response like this:

http://imageshack.us/photo/my-images/248/response2z.png/
http://imageshack.us/photo/my-images/571/response1.png/

The idea is that you take a source signal, transform it into 2 different
source signals, which have ideally the same phase and after mixing they
become the same as the original signal. It can be done using comb filtering
for example, but the results are often not really suitable for audio. 

Any ideas how to create a filter like this?

Thanks in advance.
On 10/6/12 6:25 PM, jungledmnc wrote:
> Hi, > > I want to create filter with response like this: > > http://imageshack.us/photo/my-images/248/response2z.png/ > http://imageshack.us/photo/my-images/571/response1.png/ > > The idea is that you take a source signal, transform it into 2 different > source signals, which have ideally the same phase and after mixing they > become the same as the original signal. It can be done using comb filtering > for example, but the results are often not really suitable for audio.
a comb filter has equally-spaced "teeth" in linear frequency but your displayed frequency responses are equally spaced in log frequency.
> Any ideas how to create a filter like this?
either multiple independently-tuned notch filters (or parametric EQ filters) in cascade, or a couple of FIR filters designed from your frequency response spec. i dunno of any comb filter that is naturally equally-spaced teeth in log frequency.
> > Thanks in advance.
FWIW. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
"jungledmnc" <34728@dsprelated> wrote in message 
news:-KydnemtuvF1Mu3NnZ2dnUVZ_qednZ2d@giganews.com...
> Hi, > > I want to create filter with response like this: > > http://imageshack.us/photo/my-images/248/response2z.png/ > http://imageshack.us/photo/my-images/571/response1.png/ > > The idea is that you take a source signal, transform it into 2 different > source signals, which have ideally the same phase and after mixing they > become the same as the original signal.
And the purpose of this?
> It can be done using comb filtering for example,
As noted by RBJ, comb filters work in linear frequency domain.
> but the results are often not really suitable for audio.
Unless those filters are added back in exactly same phase and amplitude, there will be terrible audio artifacts.
> Any ideas how to create a filter like this?
Filtering by FFT. VLV
Thank you. I didn't make myself so clear, comb filters produce linear
spacing, here it produces logarithmic. The thing is, it has been done using
IIRs and it seems that they are even able to control positions of the
notches, the spacing may not even be logarithmic. 

The thing is, I don't really know how to make such notches - the top of
each hill seems surprisingly flat and the slopes steep. Considering
arbitrary placement of the notches, there must be some trick to do such a
thing.

But as I said the shape doesn't need to be exactly like this, but it must
be controllable and without latency, hence probably no FFT or FIRs. And of
course, it must sum to the original signal (potentially phase shifted).
On 10/6/12 8:19 PM, jungledmnc wrote:
> Thank you. I didn't make myself so clear, comb filters produce linear > spacing, here it produces logarithmic. The thing is, it has been done using > IIRs and it seems that they are even able to control positions of the > notches, the spacing may not even be logarithmic.
that's what we call: "many separately-adjustable resonant filters in cascade".
> The thing is, I don't really know how to make such notches -
textbook or cookbook.
> the top of > each hill seems surprisingly flat and the slopes steep. Considering > arbitrary placement of the notches, there must be some trick to do such a > thing.
no trick. just a separate filter for each notch. but as Vlad says, it won't be particularly complementary. gonna be hard to make it all add up to 0 dB.
> But as I said the shape doesn't need to be exactly like this, but it must > be controllable and without latency, hence probably no FFT or FIRs.
no latency at all? no milliseconds at all? will you allow 1 sample of latency?
> And of > course, it must sum to the original signal (potentially phase shifted).
if you need complementary frequency responses, like a filter bank, and log-frequency spacing, you will need to do with with multiple FIRs all time-aligned (the low-frequency FIRs will be longer than the high-frequency FIRs, so the latter needs to be delayed). -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Hi,

to me, the frequency response looks like a graphic EQ, where odd and even
subbands are assigned to either output. 
A simple FIR filter would be inefficient, as the edge steepness of the
lowest segment ("steepness" on a linear frequency axis, not logarithmic)
will require a long impulse response. 
"Vladimir Vassilevsky" <nospam@nowhere.com> writes:

> "jungledmnc" <34728@dsprelated> wrote in message > news:-KydnemtuvF1Mu3NnZ2dnUVZ_qednZ2d@giganews.com... >> Hi, >> >> I want to create filter with response like this: >> >> http://imageshack.us/photo/my-images/248/response2z.png/ >> http://imageshack.us/photo/my-images/571/response1.png/ >> >> The idea is that you take a source signal, transform it into 2 different >> source signals, which have ideally the same phase and after mixing they >> become the same as the original signal. > > And the purpose of this?
Try the subject.
>> It can be done using comb filtering for example, > > As noted by RBJ, comb filters work in linear frequency domain.
The "linear frequency domain?" What the ...?
>> but the results are often not really suitable for audio. > > Unless those filters are added back in exactly same phase and amplitude, > there will be terrible audio artifacts.
Probably not a good use of bandwidth to state the obvious.
>> Any ideas how to create a filter like this? > > Filtering by FFT.
How are you going to get the impulse response? That is still required whether frequency-domain or time-domain filtering.
> VLV
Idiot. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
By latency I of course don't meant "no latency", just nothing like "1024
samples" etc. Phase shift will happen of course.

The thing is, I was playing with the standard "cookbook" notches, but there
are a few problems. Mostly I don't know how to align many of them - by
placing them to say each octave (500Hz, 1000Hz, 2000Hz...) they affect each
other - the gain of about 700Hz, 1400Hz etc. will get much lower. I could
compensate for this using a global gain, but it doesn't occur for nyquist,
so it would need a low-pass etc... And the results are not that all
"pretty" as in the images I posted. 


"jungledmnc" <34728@dsprelated> writes:

> By latency I of course don't meant "no latency", just nothing like "1024 > samples" etc. Phase shift will happen of course. > > The thing is, I was playing with the standard "cookbook" notches, but there > are a few problems. Mostly I don't know how to align many of them - by > placing them to say each octave (500Hz, 1000Hz, 2000Hz...) they affect each > other - the gain of about 700Hz, 1400Hz etc. will get much lower. I could > compensate for this using a global gain, but it doesn't occur for nyquist, > so it would need a low-pass etc... And the results are not that all > "pretty" as in the images I posted.
Dude, I fall back on this technique a lot: Try FDLS (frequency domain least squares). You can configure it to identify either FIR or IIR filters. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
In article <-KydnemtuvF1Mu3NnZ2dnUVZ_qednZ2d@giganews.com>, 34728@dsprelated 
says...
>Hi, > >I want to create filter with response like this: > >http://imageshack.us/photo/my-images/248/response2z.png/ >http://imageshack.us/photo/my-images/571/response1.png/ > >The idea is that you take a source signal, transform it into 2 different >source signals, which have ideally the same phase and after mixing they >become the same as the original signal. It can be done using comb filtering >for example, but the results are often not really suitable for audio. > >Any ideas how to create a filter like this? > >Thanks in advance.
You might find this ancient paper of mine useful: A Rational Technique for Synthesizing Pseudo-Stereo from Monophonic Sources Author: Orban, Robert JAES Volume 18 Issue 2 pp. 157-164; April 1970 While this applies to the s-plane only, it would be easy enough to extend it to the z-plane by using IIR filters. The basic idea is using a mid-side (sum and difference) matrix where the sum is the source signal and the difference is synthesized by passing the sum signal through a set of cascaded allpass filters.