IPB

Welcome Guest ( Log In | Register )

6 Pages V  < 1 2 3 4 > »   
Reply to this topicStart new topic
foo_convolve - Impulse response convolver, 'Mother of all effects' plugin
Garf
post Jun 22 2003, 14:18
Post #26


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



Updated

- Added auto level adjustment
- Added Wet/Dry mixer setting
- Fixed a few crashing bugs.
Go to the top of the page
+Quote Post
Garf
post Jun 22 2003, 14:22
Post #27


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



QUOTE (lucpes @ Jun 22 2003 - 11:28 AM)
BUG! [speakers off...] what happens if I load a 32bit float (IEEE) file as the impulse file? -> answer: blown tweeter fuses tongue.gif dammit... I need to get new fuses smile.gif

There is no reason that 32-bit float files won't work, except for that the component uses foobars readers for input files and 0.6x apparently has a bug in it's float readers.

Note that internally everything gets converted to 32 bit float anyway.

PS. noisevault.com is cool!
Go to the top of the page
+Quote Post
Messer
post Jun 22 2003, 16:27
Post #28





Group: Members
Posts: 568
Joined: 6-May 02
From: Warsaw / Poland
Member No.: 1977



QUOTE (Garf @ Jun 22 2003 - 03:18 PM)
- Added Wet/Dry mixer setting

Thank you rolleyes.gif
Go to the top of the page
+Quote Post
DigitalMan
post Jun 22 2003, 22:08
Post #29





Group: Members
Posts: 481
Joined: 27-March 02
From: California, USA
Member No.: 1631



Garf,
Can you add a cross channel feature? This would allow us to make one channel a mix of convolution of left and right channels (like for "crossfeed" types of applications). I guess we would need a stereo impulse response for each channel:

Left channel stereo impulse response:
Impulse response left channel: Left channel input to Left channel output
Impulse response right channel: Right channel input to Left channel output

Right channel stereo impulse response:
Impulse response left channel: Left channel input to Right channel output
Impulse response right channel: Right channel input to Right channel output

Then we might need a wet/dry mixer for the crossfeed channels too.

There is probably a more elegant solution to this, but I'm sure you get the idea.

Different subject:
Should the impulse response be dithered? I thought dither should be used at the last stage before conversion to prevent error stackup. The input signal to the convolver is not dithered, so why should the impulse response be? If the impulse response is dithered should the output dithering be disabled? I can see arguments both ways, wondering if there is a prevailing logic on this.


--------------------
Was that a 1 or a 0?
Go to the top of the page
+Quote Post
Garf
post Jun 23 2003, 00:38
Post #30


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



QUOTE
Can you add a cross channel feature?


I don't think this is worth the hassle at all, and I can't see many if any practical situations in which this would be useful.

You can crossmix after the convolver BTW. If there's a need for a crossmixer I'll make one.

QUOTE
The input signal to the convolver is not dithereds o why should the impulse response be?


Don't forget that as far as the convolver is concerned it's 32 bits floats - dithering makes little difference there. You can give it dithered input as well, for example with a CD that was properly mastered.

I would recommend simple dithering but no noise shaping for the impulse signal.

QUOTE
If the impulse response is dithered should the output dithering be disabled?


Keep output dithering enabled.
Go to the top of the page
+Quote Post
Messer
post Jun 24 2003, 03:19
Post #31





Group: Members
Posts: 568
Joined: 6-May 02
From: Warsaw / Poland
Member No.: 1977



QUOTE (Garf @ Jun 22 2003 - 03:18 PM)
- Added Wet/Dry mixer setting

There seems to be delay between original and processed signal, so wet/dry mixer does not work as it's supposed to. Try to load "dirac delta" impulse and play with the slider...
Go to the top of the page
+Quote Post
Garf
post Jun 24 2003, 14:31
Post #32


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



Yay, of course. I'll have to look whether this is fixable without significantly increasing memory consumption.
Go to the top of the page
+Quote Post
Garf
post Jun 24 2003, 15:48
Post #33


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



I just checked, and it does seem to work correctly. Note that if the impulse you are using does not have the pulse at the very first sample in the file, you will have a delay filter and 'of course' wet/dry mixing may not give what you intend, but the plugin does work correctly!

With a true dirac pulse (at sample 0), the result is the same no matter what mixer setting is used, which is correct.
Go to the top of the page
+Quote Post
Messer
post Jun 24 2003, 16:34
Post #34





Group: Members
Posts: 568
Joined: 6-May 02
From: Warsaw / Poland
Member No.: 1977



D'oh! You're right.
Of course I tried it on included unitpulse2k.wav - hence the result wink.gif
Go to the top of the page
+Quote Post
Garf
post Jun 24 2003, 16:46
Post #35


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



Yup...

It's padded out with silence because some effects cause changes/ringing before the actual pulse and I wanted to capture those so it's truely identical.
Go to the top of the page
+Quote Post
Canar
post Jun 24 2003, 16:59
Post #36





Group: Super Moderator
Posts: 3327
Joined: 26-July 02
From: princegeorge.ca
Member No.: 2796



Could you post this component on Jan's 3rd Party Plugins list so it'll get added to the site, or have you already looked into this?


--------------------
∑:<
Go to the top of the page
+Quote Post
DickD
post Jun 24 2003, 18:38
Post #37





Group: Members
Posts: 265
Joined: 12-January 03
Member No.: 4542



QUOTE (Garf @ Jun 23 2003 - 12:38 AM)
QUOTE

Can you add a cross channel feature?


I don't think this is worth the hassle at all, and I can't see many if any practical situations in which this would be useful.

You can crossmix after the convolver BTW. If there's a need for a crossmixer I'll make one.

Garf,

I'm not saying there's much need for crossmixing, but I do have an application. In a previous post I suggested a simple stereo ambience effect (which allows adding stereo ambience to a mono recording as well as to mono) that could ideally be implemented with cross-channel convolution.

The special case (theta = 90 per pass) has two factors which I've tried rather laboriously with Cool Edit (Delay and Amplify/Crossmix/Invert features), but it does work rather nicely with just 4 passes:

1. Delay between passes (e.g. 1152 samples at 44.1 kHz = 26.112 ms)
2. Attenuation Coefficient per pass (e.g. -18 dB)

Assume you have L and R original sample values, you end up adding a delayed and attenuated version with channels swapped and one inverted to the input signal.

You can then pass this delayed signal through the same transformation/attenuation and add that too. (By this stage it's -L and -R but delayed and attenuated)

As an example, if you have a delta function on the left channel only, delay by 1152 and attenuate by 6dB per pass (rather "wet" sounding), the output pulse switches channel with each pass of the delay and inverts when going from right to left:

L(0) = 1.0000

R(1152) = 0.5000

L(2304) = -0.2500

R(3456) = -0.1250

L(4608) = 0.0625

My previous post showed this on an argand diagram (complex number) representation, including options to use non-90 steps per pass, which could also be represented using separate left and right convolution functions.

That defines the left channel's stereo convolution function for 4 passes (in practice -18 dB is a subtler, less wet effect, and sounds rather natural). I must get round to posting some samples.

The right channel's stereo convolution function for 4 passes of -6 dB per pass, 1152 samples delay per pass would be:

R(0) = 1.0000

L(1152) = -0.5000

R(2304) = -0.2500

L(3456) = 0.1250

R(4608) = 0.0625

When used subtly, the effect is a rather polished sheen and space around recordings that can be quiet pleasant when used sparingly yet doesn't colour the sound's frequency response like some measured room effects or comb-filter stereo effects.

Compared to the Cool Edit approach I've used a couple of times now, I could actually save some steps in achieving this effect by generating the same-channel file with one convolution using your foo_convolve as it stands, then mix-pasting with a file created by convolving a cross-mixed version with a different convolution function (and auto gain off).

Further applications of crossmixed FIR convolution include playback of binaural material over loudspeakers (probably requires rather exact listener location, so probably not very useful) and probably some kinds of cancellation of room-interaction with loudspeakers (you need to generate the inverse convolution function to cancel out the effects). I suspect the frequency-flattening part of the latter doesn't need cross-mix, and cross mix might not add much value to it.

By the way, Garf, I note in the Readme.txt that you wrote it 18000 years in the future:
QUOTE
Copyright © 20003 Gian-Carlo Pascutto


Just thought I'd point it out. wink.gif

DickD
Go to the top of the page
+Quote Post
Garf
post Jun 24 2003, 19:05
Post #38


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



Okay, two thoughts:

1) Maybe it would be better to make a seperate plugin for this.

2) I could make crossmix impulses optional. I think they are bloat, but it is nice functionality and it's probably possible to implement them without slowing down/increasing memory usage if they aren't used. I have time now to work on this kind of thing.

QUOTE
Further applications of crossmixed FIR convolution include playback of binaural material over loudspeakers (probably requires rather exact listener location, so probably not very useful)


I don't know how this works smile.gif

QUOTE
and probably some kinds of cancellation of room-interaction with loudspeakers (you need to generate the inverse convolution function to cancel out the effects).


Inverse convolution is tricky - you can't even mathematically guarantee it works, and in practise you often end up with a lot of noise. If I got it correct, this is no more than changing a multiplication by a division in my code, so it wouldn't be very hard to try. I actually already did once but was very unimpressed by the result.

QUOTE
By the way, Garf, I note in the Readme.txt that you wrote it 18000 years in the future:
QUOTE
Copyright 20003 Gian-Carlo Pascutto


Just thought I'd point it out. wink.gif


YOU BLEW MY COVER!!1
Go to the top of the page
+Quote Post
DickD
post Jun 25 2003, 12:56
Post #39





Group: Members
Posts: 265
Joined: 12-January 03
Member No.: 4542



Sorry for blowing your cover - those time cops will be after you!

BTW, can I ask why you do an FFT in your plugin? Is it simply to measure the approximate effective scaling of the impulse response and automatically adjust the gain?

I agree that cross-mixing is bloat for most purposes (e.g. simple equalization), though it provides better representation of reflections for room simulation (particularly binaural room simulation for headphones).

The other application of cross-mixing convolution I forgot to mention is for speaker simulation on headphones. If you like the sound of your home HiFi setup in its sweet spot, you could record its impulse response on each channel in stereo using, for example, binaural headphones (like those on Jim Bamford's Binaural Field Recordings site). By crossmix-convolving that with your music, you could, for example use FB2K and foo_clienc to output MP3 or MP2 files to play on a portable with earphones that sound just like your favourite system (apart from any non-linear effects). Without crossmixing impulse responses, you don't get the crossfeed effect.

I know most people don't have binaural microphones or dummy heads to do this measurement (or the deconvolution to create a binaural effect over loudspeakers) but a few people with the right equipment could create impulse responses for a variety of pleasant-sounding loudspeaker set-ups to act as loudspeaker simulation for headphones that could be even more natural (and doubtless more coloured!) than many crossfeed plugins.

A few links relating to this are included on:
http://www.geocities.com/kangimp/

One worth looking for is Angelo Farina and his Aurora and Ramsete software. You may need to use Google or www.archive.org to download the cached versions of pages, because I'm having trouble reading them direct. This package includes some methods regarding the calculation of inverse impulse responses (i.e. for deconvolution of linear effects) and he also has numerous scientific papers on these matters. There are various methods suggested which have different qualiteis.

Getting a bit technical, division works perfectly in the Fourier domain to deconvolve in the time domain (albeit that highly attenuated frequencies when amplified back to the original level tend to be very noisy - it's division by a small number represented in a fixed-point scale). The same happens in image deblurring with 2D Fourier Transforms, where high spatial frequencies tend to become noisy in the sharpened image.

However, simply dividing by the convolution function in the time domain doesn't do the same thing. I think that's equivalent to convolution in the frequency domain (or perhaps convolution by the complex-conjugate - my memory is a bit fuzzy). I can't imagine it sounding pretty, especially with all those divide-by-zeroes!

where * represents convolution and x is multiplication:
m(t) = g(t) * h(t)
M(f) = G(f) x H(f)

If you want to recover the original signal, g(t) (which can be represented by its full Fourier Transform, G(f)) which is the sound before it was convolved by the impulse response of your system and listening room, you can take the Fourier Transform of the output, M(f) and divide it by the F.T. of the impulse response, H(f) to obtain G(f). This is the same as multiplying it by 1/H(f). If so we have:

G(f) = M(f) x (1/H(f))
so we can also say
g(t) = m(t) * inverseFFT(1/H(f))

So if you know h(t), you can derive the deconvolution function by taking its Fourier Transform, H(f), inverting it (watch out for divide-by-zero!) and taking the inverse Fourier Transform of that. You might find that this contains some complex components (I haven't thought it through to work that out), and near-infinite components (divide by zero for frequencies that were fully attenuated in the original).

For example, your DAC should contain a brickwall filter to remove frequencies between about 20 and 22.05 kHz, which the pure deconvolution function would try to correct for, leading to masses of HF noise (because of the near-zero functions). It's not desirable or pracitcal to overcome this filter, so I'd modify the deconvolution filter to act only on audible frequencies, up to around 20 kHz while not attempting to boost frequencies too near the Nyquist. This could be done in the Fourier domain, e.g. by setting zeroes instead of calculating 1/H(f) for frequency bins above +20 kHz (and those below -20 kHz in negative frequency) or it could be done by post-filtering the deconvolution function with a suitable low-pass.

There are a number of technical difficulties in these sorts of techniques and various solutions.

Impulses, being very brief, are rather low energy, and this energy is spread by the true impulse response so that the measured response is prone to being noisy (causing problems with accurate deconvolution). One method of improving the signal-to-noise ratio is to average many many impulse responses and reduce the measurement error of the average.

For simple frequency equalization, tone sweeps (chirps) can work and can contain more energy per frequency than a single Dirac delta function pulse.

From a prior life when I was heavily into research about clipped digital correlation or noisy analogue signals, I also remember techniques like chirp-Z are possible for some similar analysis (equivalent to correlation) and might be adaptable.

One nice technique, also used in radar and time-domain reflectometry, is the use of pseudorandom noise, which has a white spectrum, just like a delta function, but much higher average energy. You can either cross-correlate the received signal with the known pseudrandom input signal and determine the time signature or you can take the Fourier transform of the correlation function to determine the power spectrum. I suspect a similar technique could be adapted to deriving impulse responses and inverse convolution functions from relatively noisy measurements. A correlation function is closely related to an impulse response. Similar ideas are used in spread-spectrum communications techniques like Code Division Multiple Access (CDMA).

This post has been edited by DickD: Jun 25 2003, 13:04
Go to the top of the page
+Quote Post
Garf
post Jun 25 2003, 14:06
Post #40


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



QUOTE
BTW, can I ask why you do an FFT in your plugin? Is it simply to measure the approximate effective scaling of the impulse response and automatically adjust the gain?


The convolution works entirely in the frequency domain. It already does what you describe halfway.

QUOTE
Getting a bit technical, division works perfectly in the Fourier domain to deconvolve in the time domain (albeit that highly attenuated frequencies when amplified back to the original level tend to be very noisy - it's division by a small number represented in a fixed-point scale).


This is what I tried. I made several restrictions, one that it was restricted to zero phase filters (no complex components), and that any boost was forcedly limited to 30dB (to prevent overamplification of noise). But even reversing simple equalization didn't work all that well. It needs further experimentation.

But I will try crossmix convolution first.
Go to the top of the page
+Quote Post
KikeG
post Jun 25 2003, 14:18
Post #41


WinABX developer


Group: Developer
Posts: 1578
Joined: 1-October 01
Member No.: 137



QUOTE (DickD @ Jun 25 2003 - 12:56 PM)
For simple frequency equalization, tone sweeps (chirps) can work and can contain more energy per frequency than a single Dirac delta function pulse.

From a prior life when I was heavily into research about clipped digital correlation or noisy analogue signals, I also remember techniques like chirp-Z are possible for some similar analysis (equivalent to correlation) and might be adaptable.

One nice technique, also used in radar and time-domain reflectometry, is the use of pseudorandom noise, which has a white spectrum, just like a delta function, but much higher average energy. You can either cross-correlate the received signal with the known pseudrandom input signal and determine the time signature or you can take the Fourier transform of the correlation function to determine the power spectrum. I suspect a similar technique could be adapted to deriving impulse responses and inverse convolution functions from relatively noisy measurements. A correlation function is closely related to an impulse response. Similar ideas are used in spread-spectrum communications techniques like Code Division Multiple Access (CDMA).

In audio, MLS and IRS signals are used to derive (deconvolve) the impulse response, in a similar way to the ones you suggest. They are available too at Angelo Farina's Aurora set of plugins.
Go to the top of the page
+Quote Post
DickD
post Jun 25 2003, 15:38
Post #42





Group: Members
Posts: 265
Joined: 12-January 03
Member No.: 4542



QUOTE (Garf @ Jun 25 2003 - 02:06 PM)
The convolution works entirely in the frequency domain. It already does what you describe halfway.

...

This is what I tried. I made several restrictions, one that it was restricted to zero phase filters (no complex components), and that any boost was forcedly limited to 30dB (to prevent overamplification of noise). But even reversing simple equalization didn't work all that well. It needs further experimentation.

But I will try crossmix convolution first.

Ah, seeing that you use FFTs to actually perform the convolution, they're bound to be windowed FFTs - presumably using lapping transform windows? The mathematics about convolution in time being equivalent to multiplication in frequency domain may well break down somewhat for windowed/blocked FFTs. Also, you need to ensure that you divide one complex number by the other for it to remain true. I think if you dump the complex parts, you always obtain a symmettrical ("even") time-domain signal from the inverse FT, comprised entirely of cosine components (cosine is an even function, sine is odd (mirror image about zero), and various other exp(ix + theta) functions, where theta isn't a multiple of pi/2 are neither odd nor even).

I'm guessing that zero-phase (cosine) filters might end up beating with non-zero-phase filters in the original impulse response that you EQ'd? Just a suggestion. You wrote (or at least modified) the latest equalizer plugin, so you know how that works internally better than I do.

@KikeG: Thanks for the MLS / IRS thing for deconvolution. I found on Google a link to the Aurora site describing this, and a thread where you told me this before, so apologies for making you repeat it!

This post has been edited by DickD: Jun 25 2003, 15:41
Go to the top of the page
+Quote Post
Garf
post Jun 25 2003, 16:21
Post #43


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



QUOTE
Ah, seeing that you use FFTs to actually perform the convolution, they're bound to be windowed FFTs - presumably
using lapping transform windows? The mathematics about convolution in time being equivalent to multiplication in frequency domain may well break down somewhat for windowed/blocked FFTs.


Given that the overlapping is done properly, it doesn't. I started with a FIR convolver and optimized it.

QUOTE
I'm guessing that zero-phase (cosine) filters might end up beating with non-zero-phase filters in the original impulse response that you EQ'd?


I think foobars equalizer is zero-phase also, but I'm not sure. (I was inverting the original equalizer).
Go to the top of the page
+Quote Post
tacitus10
post Jun 25 2003, 18:01
Post #44





Group: Members
Posts: 112
Joined: 23-July 02
Member No.: 2748



Brilliant plugin!

I was wondering if you might consider adding a pre delay slider eg:- from -500 to +500 ms.
This would be great for old tape delay impulses as well as offset problems with badly trimmed impulses.

Thanks again, keep up the good work.

P.S.
Check out:-
http://sound.media.mit.edu/KEMAR.html

For impluses of 3d spacial positioning based upon how the human ear hears. Useful for sound design (especially for film).
Go to the top of the page
+Quote Post
Garf
post Jun 25 2003, 18:40
Post #45


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



For regulating delay edit the impulse. It makes no sense whatsoever to make this configurable in the plugin.
Go to the top of the page
+Quote Post
tacitus10
post Jun 27 2003, 19:42
Post #46





Group: Members
Posts: 112
Joined: 23-July 02
Member No.: 2748



All professional digital reverbs have pre-delay sliders/knobs. This is also true of convolution units. Pre-delay can make a room sound "larger".
Go to the top of the page
+Quote Post
Garf
post Jun 27 2003, 20:14
Post #47


Server Admin


Group: Admin
Posts: 4853
Joined: 24-September 01
Member No.: 13



I don't care what design mistakes other people made. You can do it by editing the impulse. There is no point to including it in the component.
Go to the top of the page
+Quote Post
tacitus10
post Jun 28 2003, 15:09
Post #48





Group: Members
Posts: 112
Joined: 23-July 02
Member No.: 2748



Lexicon, TC, & Waves units do not use impulses to achieve reverb, yet these companies include pre-delay in all their reverb units as it is considered essential.

It seems, however, you have already made up your mind though. I was just hoping you could make this great plugin perfect, thats all.

Thanks again for your plugin.
Go to the top of the page
+Quote Post
kode54
post Jun 28 2003, 15:38
Post #49





Group: Admin
Posts: 4498
Joined: 15-December 02
Member No.: 4082



Another interesting proposition, possibly required for certain types of effects... mid/side impulses.

Positive pulse similar to unitpulse2k.wav passed through effect -> mid impulse.
Positive pulse in one channel with negative pulse in opposite channel passed through effect -> side impulse.

Output = Mid calculated from stereo input -> mid impulse
Output += Side calculated from stereo input -> side impulse

Probably only useful for stealing stereo expansion effects from closed source or closed license software signal filters.
Go to the top of the page
+Quote Post
Canar
post Jun 29 2003, 20:00
Post #50





Group: Super Moderator
Posts: 3327
Joined: 26-July 02
From: princegeorge.ca
Member No.: 2796



QUOTE (tacitus10 @ Jun 28 2003 - 06:09 AM)
Lexicon, TC, & Waves units do not use impulses to achieve reverb, yet these companies include pre-delay in all their reverb units as it is considered essential.

It seems, however, you have already made up your mind though.  I was just hoping you could make this great plugin perfect, thats all.

Thanks again for your plugin.

What Garf is saying is that the convolver _SUPPORTS_ pre-delay. It is achieved by simply editing the impulse. There are a thousand and one different ways to permute the impulse before it is used, and the most efficient way to support them all is to make the end-user apply them before the plug-in deals with the impulse.

Furthermore, reverb is impossible without impulses. Reverb itself is just a specialized case of a convolution filter. Even if your DSP takes the input audio, delays it 50ms, then mixes it back into the music at half-volume or something, that is just a hard-coded convolution filter. I know that's a little pedantic, but it is the truth.

Perhaps it is exactly because they do not use a traditional convolution filter for their reverb that they feel it necessary to include a pre-delay function. Are there any reverberators out there that use convolution but still do the pre-delay thing?

This post has been edited by Canar: Jun 29 2003, 21:08


--------------------
∑:<
Go to the top of the page
+Quote Post

6 Pages V  < 1 2 3 4 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th April 2014 - 14:51