Other waveforms with MinBLEPs ?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

dwerner wrote: I have code for generating MinBLEPs posted on my site at http://experimentalscene.com/dsp/minbleps.php
dwerner: I tried your code for generating minbleps...and use these to do BL synthesis.
I compared the output (for 32 zero crossings, 64*oversampling, which I think is what Eli is using) to what you compute, but your output looks soo much different... It almost looks like theres an accumulating dc offset added for each sample.
So, I was wondering...how should I use this code to generate minbleps like Eli's?
Thanks!

Post

karmafx wrote:
dwerner wrote: I have code for generating MinBLEPs posted on my site at http://experimentalscene.com/dsp/minbleps.php
dwerner: I tried your code for generating minbleps...and use these to do BL synthesis.
I compared the output (for 32 zero crossings, 64*oversampling, which I think is what Eli is using) to what you compute, but your output looks soo much different... It almost looks like theres an accumulating dc offset added for each sample.
So, I was wondering...how should I use this code to generate minbleps like Eli's?
Thanks!
Sorry about that, the code on my site had a bug. It has now been fixed, please download it again. The DFT and InverseDFT routines weren't changed properly since in my program I use a sin table to speed the computation up, but I remove this in the public code to make it easier to understand.

Post

mr werner, just wanted to say that the code on your site is great. The simplified DFT is the clearest I've ever seen one. I'll get to grips with code as I can.

When you implement a sin lookup, how do you go about it. Since I grew up with degrees, rather than radians, when I have implemented a lookup, it's usually been a multiple of 90 (and recalc the offset) or 360. But the deg->rad conversion has sucked up cycles, making a straight sin(x) pretty much as fast. What is the best way to do a 'native' radian lookup? (I missed the code on your site..)

thx
DSP
Image

Post

duncanparsons wrote:When you implement a sin lookup, how do you go about it. Since I grew up with degrees, rather than radians, when I have implemented a lookup, it's usually been a multiple of 90 (and recalc the offset) or 360. But the deg->rad conversion has sucked up cycles, making a straight sin(x) pretty much as fast. What is the best way to do a 'native' radian lookup?
deg-rad conversion should be one multiply, which is extremely cheap on a modern system.

If you use a table that's a power of 2 in size (256, 512, 1024 depending on accuracy vs. memory tradeoffs), rather than 90 or 360, then you can use an "AND" operation to wrap the table.
Image
Don't do it my way.

Post

duncanparsons wrote:mr werner, just wanted to say that the code on your site is great. The simplified DFT is the clearest I've ever seen one. I'll get to grips with code as I can.

When you implement a sin lookup, how do you go about it. Since I grew up with degrees, rather than radians, when I have implemented a lookup, it's usually been a multiple of 90 (and recalc the offset) or 360. But the deg->rad conversion has sucked up cycles, making a straight sin(x) pretty much as fast. What is the best way to do a 'native' radian lookup? (I missed the code on your site..)

thx
DSP
I generate a table with 2 Pi radians (one full cycle of the sin function). The code below is inside a loop where phase goes from 0.0f to 1.0f.

Code: Select all

SinTable->Data[sample] = sinf(phase * PI * 2.0f);
Below is a copy of the code inside DarkWave's CoreMachines DLL code. I have commented out the multiply by 2 Pi, so the variable p is phase rather than radians. Then I call getsample which linearly interpolates a value in the table based on the phase.

Code: Select all

      p  = (/* 2.0f * PI * */ (float)(k * i)) / n;
      sr =  CosTable->GetSample(p);  //cosf(p);
      si = -SinTable->GetSample(p);  //-sinf(p);
      realFreq[k] += (realTime[i] * sr) - (imagTime[i] * si);
      imagFreq[k] += (realTime[i] * si) + (imagTime[i] * sr);
So, since DFT works in radians, you remove the multiplication by 2 Pi so it works in phase, which is a floating point fraction of the table length. Then there is no conversion at all. Hope this helps.[/code]

Post

thank you both very much!

I'll implement that..

DSP
Image

Post Reply

Return to “DSP and Plugin Development”