Single Cycle Extraction

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi there

As part of some software I'm doing , I'm looking at finding loop points in a sample, ideally to isolate a loopable single wavecycle

What I've done at the moment, is first look forward from the inital point for a zero crossing, this is the loop start point.

I then start looking for a further zero crossings (ignoring any which are too close to the loop start point). This will be the loop finish point.

Further more I look for zero crossing which are in opposite directions, if the start point was from negative to positive, the finish point should be from positive to negative and vica versa.

Finally after this I do a bit of smoothing of the start and finish of the wavecycle to get rid of any glitches when it loops

This seems to be a reasonable way of doing loop point extract, the results are ok but probably could be improved.

Does any one have ideas that could improve this process or any links to anything relating to this type of thing.

For instance , would low-pass filtering of the sample before finding loop points help ?

Any ideas or feedback would be most welcome

Cheers

Jon : COFX

Post

I've been working on a wavetable synth for a little while in my spare time and I wrote a utility to extract single cycles using pitch detection. More specifically, I use auto-correlation to get the period of the wave and then I start extracting at a zero crossing and finish extracting at the zero crossing closest to the period length. This has had very good results for me.

-Quinn

Post

After looking back at my code, looks like I used the AMDF (Average Magnitude Distance Function) algorithm to do the pitch detection. Here are a few resources (there are probably better ones, but I found these as a start):

http://www.ece.odu.edu/~zahorian/pdf/Ye ... Kavita.pdf
http://www.asel.udel.edu/icslp/cdrom/vol2/218/a218.pdf
http://www.geocities.com/Vienna/Choir/4792/wavecir.html

-Quinn
Double Dog Audio

Post

Hi there

That's very interesting, thanks for the links. I had though of auto-correlation , but it does seem a bit cpu intensive.

CHeers

Jon : COFX

Post

I wasn't worried about performance since I use the pitch detection in a stand-alone utility for building wavetables, not in the VST plug-in itself. AMDF is pretty efficient if you know the approximate pitch of the sample you are analyzing (can provide reasonably close minimum and maximum pitch bounds).

-Q

Post

Hi there

Yes it seems to work quite well, I only did the auto-corelation once in a bit in on the sample, and used this for the pitch of the whole sample, and for samples which don't very much in pitch it's much better than zero-crossing type thingie


Thanks for the ideas

Cheers

Jon : Concrete

Post Reply

Return to “DSP and Plugin Development”