ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Convolution Patch Pure Data
    카테고리 없음 2020. 3. 18. 22:50

    Said:Hi All,I am in the process of creating a patch that could generate an inverse filter for an acoustic test signal (Log Swept sine) and then perform a deconvolution of the recording of the signal in the space.I'm looking into the deconvolution process too (any help from anyone would be great!).Have downloaded the package from with.I've tried running it on, hacking around to try and get it to run without any luck.If the deconvolution was to be implemented in Pd, is it as simple as fft of 'response' (initial delay snipped off) minus fft of 'test sweep'? Or have I got the wrong end of the stick? Said:said:If the deconvolution was to be implemented in Pd, is it as simple as fft of 'response' (initial delay snipped off) minus fft of 'test sweep'?It is slightly more complicated. First invert phase spectrum and magnitude spectrum of original sweep to create deconvolution kernel. Then use partconv from bsaylor library for fast convolution.KatjaOkay, not sure where to start with that - shot in the dark from a vague MaxMSP memory, maybe process the lists from cartesian to polar coordinates (or visa versa) then.-1 +1?I ask as I'm trying out things, they all sound a bit wrong so far. Said:maybe process the lists from cartesian to polar coordinates (or visa versa) then.-1 +1?Not sure what you mean exactly.

    1. Convolution Patch Pure Data Download

    Admittedly, my suggestion was rather cryptic as well.Anyway, I was thinking about the situation of a test signal: how long is that signal? Probably too long to fit in one fft frame of reasonable length. In that case, I don't think you can invert it's phase spectrum in frequency domain.

    But no problem: just do a time reversal in signal domain, and it's phase spectrum will be inverted automatically. To be explicit here: I mean you must time-reverse the samples of the original test sweep (not the test result signals). Time reversal does not change the magnitude spectrum, only the phase spectrum.So remains inverting the magnitude spectrum of the time-reversed test sweep. A log sweep does not have a flat magnitude spectrum, so you need to compute the multiplicative inverse of the magnitude coefficients (in frequency domain, using polar coordinates indeed here). Beware of possible zero-magnitude points in the original, they can not be inverted of course. After magnitude inversion, go back to cartesian coordinates and from them to time domain. Now you have your deconvolution kernel in time domain.The deconvolution kernel is the test sweep with phase and magnitude spectrum inverted.

    Convolution Patch Pure Data Download

    It can be considered a (very long) FIR filter. With this kernel you can do fast convolution of the test results, to deconvolve these. For this, you can use Ben Saylor's partconv object. It does 'partitioned convolution' in frequency domain, with zero padding to avoid circular convolution.Good luck. Please let us know if you have succes. It is an interesting technique to create impulse responses of acoustic conditions. Expensive reverb simulators probably rely on similar techniques.

    What is actually your purpose for it?Katja. Thanks for your help Katja, hopefully I can get there.My purpose is that I'm moving from a desktop based setup to a laptop after ten years. I overlooked the fact that magnitude inversion has to be done in one single fft frame as well.

    Releases

    For your test signal of 352800 samples that means a 2^19 point fft. Though it need not theoretically be a problem, Pd can not handle fft with that blocksize.Several other options remain.1. If you could do with a linear sweep test signal, you don't need to invert magnitude spectrum because a carefully constructed linear sweep has flat spectrum. The time-reversal to invert phases would suffice.2. Invert the log sweep's spectrum in another software that can do very long fft's.Will partconv be able to handle long impulse responses? According to the object's c code it can do up to 256 partitions.

    Your test signal is done in 178 partitions of size 2048 so that should be ok.What is by the way the formula of your test signal? Did you create it in a Pd patch? I'd like to know.Katja. Lead, I found that Pd can do 2^17 point fft apparently without trouble. If we can construct a log sweep of exactly that size, the inverse can be computed within Pd.The code and description on ccrma.stanford site in your link imply that deconvolution is done in frequency domain using circular (de)convolution, by complex division with the original sweep spectrum. That is why they use two copies of the sweep in one signal.We can not do that in Pd because of the fft size limitation. But we can do non-circular convolution with partconv.

    System

    Therefore we need to create our own sweep and inverse sweep.The line which I do not understand in the Matlab sweep code is:t = linspace(0,T-1/fs,fs.T);I am too lazy to learn Matlab/Octave, so I can't translate this to math or Pd. Does anyone happen to know what it does?Katja. From Octave help:- Built-in Function: linspace (BASE, LIMIT, N)Return a row vector with N linearly spaced elements between BASEand LIMIT. If the number of elements is greater than one, thenthe BASE and LIMIT are always included in the range. If BASE isgreater than LIMIT, the elements are stored in decreasing order.If the number of points is not specified, a value of 100 is used.The `linspace' function always returns a row vector.For compatibility with MATLAB, return the second argument if fewerthan two values are requested.

Designed by Tistory.