Page 1 of 2

Advanced DSP Question

Posted: Tue Dec 09, 2014 8:30 pm
by Youlean
Hey guys, is there any way to count how many samples is audio being above 0, and to place that information before >0 occurs with delaying original audio?

Re: Advanced DSP Question

Posted: Tue Dec 09, 2014 10:54 pm
by tester
+1

Would be interesting to be able to count in parallel (sample accurate) amounts of samples within specified min/max ranges. [output can be float type and not integer type, because calculations made on that are rather approximations).

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 12:01 am
by KG_is_back
I'm not exactly sure what you are trying to do... With the counting samples, the thing is fairly simple:

Code: Select all

streamin in;
streamout out;
float c;
float above;
float pin;

above=(in>0)&(pin<=0);
out=out+(c-out)&above;
c=c+1-c&above;


With the delaying, I'm not sure what you are looking for...

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 12:33 am
by Youlean
Look at the picture. I could post a FSM if you need it, but it is very messy...

Basically I want to calculate cycle length and to have that information right before cycle occurs, so I can set accurate release, independent for every cycle in envelope follower.

Logic is to:

audio -> fixed delay
audio -> sample counter -> variable delay(fixed delay - cycle length)

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 12:36 am
by tester
As for me, I still don't know what I'm doing. ;-) Yesterday an idea came to me, and I'm trying to figure out what is it about. Probably some sort of a measurement within a filter-like something.

The concept is.

Audio resolution is n bits (but this is related to signals in general and some statistical calculations). I'd like to measure how many sample-to-sample differences fit bit ranges (1bit range ~ 0-6dB, 2bit range ~ 6-12dB, etc), and compare these outcomes to each other.

I'm still not sure what for this is useful, but I find it... intriguing. Maybe it may be helpful somehow to describe audio true dynamics of a compressed/pumped signal? Or level of subtleness in details? I don't know yet. :mrgreen:

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 12:43 am
by Youlean
What do you mean by sample to sample differences?

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 12:53 am
by KG_is_back
As you suggest All you have to do, is to put constant delay on original audio. Detect the positive pulse length from the original (non-delayed) input. The event you want to happen should occur at constant delay minus detected length. That is the amount of time you need to delay the "side-chain" input, if you wish so. The delay will be modulated in a jump fashion but that shouldn't be a problem.

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 11:25 am
by tester
Youlean wrote:What do you mean by sample to sample differences?


(sampleN) minus (sampleN+1). In short terms - gain differences between samples. Following curiosity - I'd like to see - how much fluctuations are going on in dynamic ranges defined by bits (or 6dB steps). And then - I'd like to hear what it means in audible terms.

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 4:46 pm
by Youlean
KG_is_back wrote:As you suggest All you have to do, is to put constant delay on original audio. Detect the positive pulse length from the original (non-delayed) input. The event you want to happen should occur at constant delay minus detected length. That is the amount of time you need to delay the "side-chain" input, if you wish so. The delay will be modulated in a jump fashion but that shouldn't be a problem.


Indeed, there where some bug in my schematics, but now it seams to work...

Re: Advanced DSP Question

Posted: Wed Dec 10, 2014 4:47 pm
by Youlean
tester wrote:
Youlean wrote:What do you mean by sample to sample differences?


(sampleN) minus (sampleN+1). In short terms - gain differences between samples. Following curiosity - I'd like to see - how much fluctuations are going on in dynamic ranges defined by bits (or 6dB steps). And then - I'd like to hear what it means in audible terms.


Well test it and see what it will do... :)