SynthMaker

How to detect peaks? (multiband)

Archive · 2012 6 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

MDMA ·

Hi guys, First of all I'd like to thank all of you who submited schematics and tuts to help us out, thanks to you my interest for synth programing has manifested in me and I'm having a lot of fun building synths.

I would like to ask for an aproach of how to detect the highest peak/peaks of sound in db and find out its freq.

Im working on an auto tune function for a synth where I have 2 signals from diferent sources and I want to find out their first harmonica/dominant freq. and tune them to match each other.

I'm also working in an Multiband distortion effect and would like to ask you how should I separate and process diferent freq areas. Would you use filters, freq spliters, or something else?

I know this is kind of a 2 questions in one post but maybe these 2 are related and knowing about one might help with the other.

Thanks in advance.

Dell ·

To detect the highest peak in terms of frequencies, you will require a Spectrum Analyser. The House Spectrum Analyser should be able to help you. If you require certain frequencies listed, you can add or adjust frequency labels inside the module.

Cheers!

trogluddite ·

There are also a couple of approaches which work fully using streams - these may be better for real-time applications as the stock spectrum analyser uses the 'green' FFT primitives, which can only be polled at a relatively low rate (maybe an OK compromise for you? - the CPU load is quite low).

Martin's auto-correlation type pitch detector is very accurate and well made - you can find it here... Pitch Extractor

There is also my own, rather more crude version, based on frequency splitting the sound, and counting the zero crossings - the sole advantage is the much lower CPU usage.... Grrr - guitar synth (the individual detector module is somewhere a little way into the thread, the full synth has some splitters too).

For your distortion, frequency splitters are probably the easiest solution - they will be low CPU, and as you are seeking to 'dirty' the sound anyway, any phase shifts in the filters are unlikely to compromise the sound. There's a decent one on the Wiki (as used in Grrrr) - or use one of the many LPF filters around (plenty of choice of dB/octave slope etc.), and use (HPF = Audio - LPF) to create the inverse response for the upper band.

MDMA ·

Thanks guys, I'll looking into it and get back to you if I cant understand it.

oddson ·

MDMA wrote: I would like to ask for an aproach of how to detect the highest peak/peaks of sound in db and find out its freq.

Im working on an auto tune function for a synth where I have 2 signals from diferent sources and I want to find out their first harmonica/dominant freq. and tune them to match each other.

I have something for some work I did towards a guitar tuner and general pitch detection that used the max frequency from the FFT green primitives. The problem is the maximum frequency is not from the fundamental. But you may find this helpful:

It uses Jain's method (see http://www.dspguru.com/dsp/howtos/how-t ... e-fft-peak) to interpolate the frequency using the max bin value and the two adjacents -- mostly because it looked easy to do in SynthMaker.

The N size in how many bins the FFT uses -- the more there the more accurate the results. The max frequency range can help it avoid looking it the upper range when the N size it large.

Dell ·

Very nice detection Oddson!

With a little bandpass filtering, one could create a twelve (or more) octave peak analyser. 🙂

Cheers!

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.