Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
26th August 2005, 00:23 | #1 | Link | |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
AudioConvolution filter
I was in the mood to code something, but a bit too wiped out to try anything hard... so I built a very simple audio plug-in.
Quote:
AudioConvolution(clip input, clip kernel) You must pass in clips with video; audio must be 16-bit; kernel must have mono audio. kernel should only have a single figure number of nonzero points. (Or else it becomes very slow) I've only tested it once, with a mono input. Incidentally, this makes no attempt to be fast whatsoever. This is a throwaway thing and I don't plan to add features to it (though I will fix bugs!). I might speed it up a bit though... Edit: A slightly faster version... AudioConvolution, 26Aug05 So you should be able to feed it larger kernels. By the way, when I said very slow above, I meant slower than real-time ... if you don't mind waiting to encode the audio larger kernels should work fine... but try on kernels with < 30 nonzero values first, to check whether it's working. I know whats slowing it down, and it can be fixed to allow yet larger kernels. I can deal with it if anyone actually has an interest in using this thing.
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. Last edited by mg262; 26th August 2005 at 10:03. |
|
26th August 2005, 11:19 | #2 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
haha! you rock!
it's not really usable yet (i was thinking kernels in the region of 512-1024 points), but it's definitely a start. a convolver in avisynth means all possible kinds of passive filters can be made in avisynth now (so long as you have another program capable of making the impulses...). i gather it's faster to export audio through virtualdub, then use something like foobar's convolver to do the dirty work? still, it's a very good start. i can see a lot of impulse files being posted here to get rid of certain problems (pilot tones! yaaaah!) with audio.
__________________
sucking the life out of your videos since 2004 |
26th August 2005, 11:56 | #3 | Link | |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
Quote:
I don't think it is intrinsically slow... AVISynth requests about 2000 samples at a time, but the filter needs to look back maybe on the order of 20,000 (depending on the kernel). So it requests 10 times as many source samples as needed. Can be fixed with a buffer of one kind or another. Scratch the comment about the second clip requiring video... this works fine with the 26th August version: AudioConvolution(wavsource("echo.wav"))
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. |
|
26th August 2005, 15:37 | #6 | Link | ||
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
Guys, guys,
Quote:
Quote:
Edit: @tsp, if I do modify it to use fftw, is it as simple as calling one function on source chunk and kernel, multiplying, and calling that function again? (Probably with size rounded up to multiple of two.) Or does it take a lot more work to use the library? Thanks!
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. Last edited by mg262; 26th August 2005 at 17:54. |
||
26th August 2005, 20:40 | #8 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
well as long as the partionsize is a power of 2 the slowdown shouldn't be that inefficient. I mean on a modern computer there should be more than enough proccesing power to do the fft in realtime. Have a look at my variableblur sourcecode (gaussian.cpp/.h) for how it is possible to use fftw to do a 2d convolution (of course with audio it is only 1d=faster)
|
Thread Tools | Search this Thread |
Display Modes | |
|
|