De-zipper code?

For general discussion related FlowStone
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: De-zipper code?

Post by Perfect Human Interface »

Interesting. Using a hop of any size would mean the smoother doesn't react to changes in the input immediately though right?
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: De-zipper code?

Post by Spogg »

Perfect Human Interface wrote:I think Spogg's might be too subtle to visualize.


Mine was made for a specific fixed purpose. For different smoothing you would need n x single sample delays and multiply by 1/(n+1) for correct averaging.

The one I uploaded was to give an approximately 5uS total rise time for an instant full scale( 0-1) step change.

It works, but really I just wanted to join in a bit. Sad or what? :lol:

Cheers

Spogg
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: De-zipper code?

Post by tulamide »

Perfect Human Interface wrote:Interesting. Using a hop of any size would mean the smoother doesn't react to changes in the input immediately though right?

Yes. Hop(x) means, it omits x samples. hop(2048) means active on sample 0, sample 2048, sample 4096, sample 6144, sample 8192, etc.
"There lies the dog buried" (German saying translated literally)
SBAudio
Posts: 6
Joined: Tue Jan 14, 2014 10:40 pm
Contact:

Re: De-zipper code?

Post by SBAudio »

Needed the dezipper code myself. This seems to be very close, and possibly more stable as well.

Code: Select all

streamin i;
streamin duration;
streamout o;

float samplerate = 44100;
float coef;
float last;
float step;

coef = 1 / (duration / 1000 * samplerate);

step = step + (last != i) &  (coef * (i - o) - step);

o = o + (step < 0) & (max(o + step, i) - o);
o = o + (step > 0) & (min(o + step, i) - o);

last = i;
Post Reply