DSPRelated.com
Forums

Thresholding for Note Onset Detection

Started by bloodfire1004 June 24, 2011
Hi!

Regarding Note Onset Detection (that is, trying to find where a new note
begins), I am having problems on trying to determine what my threshold
should be.

Currently, what I am just doing is finding the maximum change in intensity
and then getting a percentage of that and setting that as my threshold.

The problem is that, this is troublesome if there are various degrees of
difference in amplitude energy. Also, if the threshold is too low, there
are a lot of ghost notes and if it is too high, it misses out on some
actual notes.

Do any of you know any way around this?

Thank you!

bloodfire1004 wrote:
> > Hi! > > Regarding Note Onset Detection (that is, trying to find where a new note > begins), I am having problems on trying to determine what my threshold > should be. > > Currently, what I am just doing is finding the maximum change in intensity > and then getting a percentage of that and setting that as my threshold. > > The problem is that, this is troublesome if there are various degrees of > difference in amplitude energy. Also, if the threshold is too low, there > are a lot of ghost notes and if it is too high, it misses out on some > actual notes. > > Do any of you know any way around this?
Are you using a log based scale (like decibels)?
> > Thank you!
> > >bloodfire1004 wrote: >> >> Hi! >> >> Regarding Note Onset Detection (that is, trying to find where a new
note
>> begins), I am having problems on trying to determine what my threshold >> should be. >> >> Currently, what I am just doing is finding the maximum change in
intensity
>> and then getting a percentage of that and setting that as my threshold. >> >> The problem is that, this is troublesome if there are various degrees
of
>> difference in amplitude energy. Also, if the threshold is too low,
there
>> are a lot of ghost notes and if it is too high, it misses out on some >> actual notes. >> >> Do any of you know any way around this? > >Are you using a log based scale (like decibels)? > > >> >> Thank you! >
Currently, Im using just the raw amplitude data (I think Hz?), that is, the energy at a certain time in the time-domain. I try to improve my results by trying to use various filters/pre-processing methods.
On 06/24/2011 02:55 AM, bloodfire1004 wrote:
> Hi! > > Regarding Note Onset Detection (that is, trying to find where a new note > begins), I am having problems on trying to determine what my threshold > should be. > > Currently, what I am just doing is finding the maximum change in intensity > and then getting a percentage of that and setting that as my threshold. > > The problem is that, this is troublesome if there are various degrees of > difference in amplitude energy. Also, if the threshold is too low, there > are a lot of ghost notes and if it is too high, it misses out on some > actual notes. > > Do any of you know any way around this?
This is a variation of detecting on-off keying, and yup, it's gonna be hard. Are you trying to detect notes in real time, or after the fact? If it's after the fact then try an after the fact approach: start by determining that a note's there, then work backward to figure out how it builds after it's struck (or whatever), then use that information to determine onset. You'll still have the problem of ghost notes vs. missed notes, but at least you're not going to be getting the timing all messed up at the same time. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
>On 06/24/2011 02:55 AM, bloodfire1004 wrote: >> Hi! >> >> Regarding Note Onset Detection (that is, trying to find where a new
note
>> begins), I am having problems on trying to determine what my threshold >> should be. >> >> Currently, what I am just doing is finding the maximum change in
intensity
>> and then getting a percentage of that and setting that as my threshold. >> >> The problem is that, this is troublesome if there are various degrees
of
>> difference in amplitude energy. Also, if the threshold is too low,
there
>> are a lot of ghost notes and if it is too high, it misses out on some >> actual notes. >> >> Do any of you know any way around this? > >This is a variation of detecting on-off keying, and yup, it's gonna be
hard.
> >Are you trying to detect notes in real time, or after the fact? If it's >after the fact then try an after the fact approach: start by determining >that a note's there, then work backward to figure out how it builds >after it's struck (or whatever), then use that information to determine >onset. > >You'll still have the problem of ghost notes vs. missed notes, but at >least you're not going to be getting the timing all messed up at the >same time. > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >Do you need to implement control loops in software? >"Applied Control Theory for Embedded Systems" was written for you. >See details at http://www.wescottdesign.com/actfes/actfes.html >
Hi! Yes, Im doing it after recording and not in real-time. So yes, I think Im getting what you are saying, in that after thresholding and peak-picking process, there is still a post-processing to do. Thanks! Incidentally, do you know if working with the frequency domain would be better than working with the time-domain? I am working on percussive onsets, particularly guitar.
On Jun 24, 10:20�pm, "bloodfire1004"
<bloodfire1004@n_o_s_p_a_m.yahoo.com> wrote:
> >On 06/24/2011 02:55 AM, bloodfire1004 wrote: > >> Hi! > > >> Regarding Note Onset Detection (that is, trying to find where a new > note > >> begins), I am having problems on trying to determine what my threshold > >> should be. > > >> Currently, what I am just doing is finding the maximum change in > intensity > >> and then getting a percentage of that and setting that as my threshold. > > >> The problem is that, this is troublesome if there are various degrees > of > >> difference in amplitude energy. Also, if the threshold is too low, > there > >> are a lot of ghost notes and if it is too high, it misses out on some > >> actual notes. > > >> Do any of you know any way around this? > > >This is a variation of detecting on-off keying, and yup, it's gonna be > hard. > > >Are you trying to detect notes in real time, or after the fact? &#4294967295;If it's > >after the fact then try an after the fact approach: start by determining > >that a note's there, then work backward to figure out how it builds > >after it's struck (or whatever), then use that information to determine > >onset. > > >You'll still have the problem of ghost notes vs. missed notes, but at > >least you're not going to be getting the timing all messed up at the > >same time. > > >-- > > >Tim Wescott > >Wescott Design Services > >http://www.wescottdesign.com > > >Do you need to implement control loops in software? > >"Applied Control Theory for Embedded Systems" was written for you. > >See details athttp://www.wescottdesign.com/actfes/actfes.html > > Hi! Yes, Im doing it after recording and not in real-time. So yes, I think > Im getting what you are saying, in that after thresholding and peak-picking > process, there is still a post-processing to do. Thanks! > > Incidentally, do you know if working with the frequency domain would be > better than working with the time-domain? I am working on percussive > onsets, particularly guitar.
Onset is a time-domain concept. Seeking it in the frequency domain seems odd. Jerry -- Engineering is the art of making what you want from things you can get.
>Onset is a time-domain concept. Seeking it in the frequency domain >seems odd. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >
Well, because Ive been reading some papers and I read that working only with the time-domain yields less better results than working with say, high-frequency content, spectral energy difference, phase-deviation, or complex domain, which I believe are all algorithms that work with the frequency-domain. Regardless, I do really just want to work with the time-domain and keep it simple as there are other aspects of my project that also need attention. But I would also like help regarding other algorithms to try and improve my algo. Thanks!
>On Jun 24, 10:20=A0pm, "bloodfire1004" ><bloodfire1004@n_o_s_p_a_m.yahoo.com> wrote: >> >On 06/24/2011 02:55 AM, bloodfire1004 wrote: >> >> Hi! >> >> >> Regarding Note Onset Detection (that is, trying to find where a new >> note >> >> begins), I am having problems on trying to determine what my
threshold
>> >> should be. >> >> >> Currently, what I am just doing is finding the maximum change in >> intensity >> >> and then getting a percentage of that and setting that as my
threshold=
>. >> >> >> The problem is that, this is troublesome if there are various
degrees
>> of >> >> difference in amplitude energy. Also, if the threshold is too low, >> there >> >> are a lot of ghost notes and if it is too high, it misses out on
some
>> >> actual notes. >> >> >> Do any of you know any way around this? >> >> >This is a variation of detecting on-off keying, and yup, it's gonna be >> hard. >> >> >Are you trying to detect notes in real time, or after the fact? =A0If
it=
>'s >> >after the fact then try an after the fact approach: start by
determining
>> >that a note's there, then work backward to figure out how it builds >> >after it's struck (or whatever), then use that information to
determine
>> >onset. >> >> >You'll still have the problem of ghost notes vs. missed notes, but at >> >least you're not going to be getting the timing all messed up at the >> >same time. >> >> >-- >> >> >Tim Wescott >> >Wescott Design Services >> >http://www.wescottdesign.com >> >> >Do you need to implement control loops in software? >> >"Applied Control Theory for Embedded Systems" was written for you. >> >See details athttp://www.wescottdesign.com/actfes/actfes.html >> >> Hi! Yes, Im doing it after recording and not in real-time. So yes, I
thin=
>k >> Im getting what you are saying, in that after thresholding and
peak-picki=
>ng >> process, there is still a post-processing to do. Thanks! >> >> Incidentally, do you know if working with the frequency domain would be >> better than working with the time-domain? I am working on percussive >> onsets, particularly guitar. > >Onset is a time-domain concept. Seeking it in the frequency domain >seems odd.
I don't know how you could detect note onset without a strong spectral element in the analysis. It would just be noise onset without that. Steve
...
> > >> Incidentally, do you know if working with the frequency domain would be > >> better than working with the time-domain? I am working on percussive > >> onsets, particularly guitar.
so, is this for a guitar-to-MIDI converter? you'll need a pitch detector in addition.
> >Onset is a time-domain concept. Seeking it in the frequency domain > >seems odd. > > I don't know how you could detect note onset without a strong spectral > element in the analysis. It would just be noise onset without that. >
i think, if you're confident that there is only one note at a time, that maybe all you need is some sorta HPF before an envelope follower. it's possible to bandsplit the input into a bank of filters, and envelope detect the output of each. exactly what logic that comes after that (how many or which filter outputs having sharp transitions is sufficient to identify it as a new note) is something that designers might keep secret. an additional issue, particularly with the guitar, is that of the hammer-on or release. you might have an insufficient transition in amplitude but the pitch changes suddenly. it's a new note. how do you detect that? r b-j
>... >> >> >> Incidentally, do you know if working with the frequency domain would
be
>> >> better than working with the time-domain? I am working on percussive >> >> onsets, particularly guitar. > >so, is this for a guitar-to-MIDI converter? you'll need a pitch >detector in addition. > > >> >Onset is a time-domain concept. Seeking it in the frequency domain >> >seems odd. >> >> I don't know how you could detect note onset without a strong spectral >> element in the analysis. It would just be noise onset without that. >> > >i think, if you're confident that there is only one note at a time, >that maybe all you need is some sorta HPF before an envelope follower. > >it's possible to bandsplit the input into a bank of filters, and >envelope detect the output of each. exactly what logic that comes >after that (how many or which filter outputs having sharp transitions >is sufficient to identify it as a new note) is something that >designers might keep secret. > >an additional issue, particularly with the guitar, is that of the >hammer-on or release. you might have an insufficient transition in >amplitude but the pitch changes suddenly. it's a new note. how do >you detect that?
Its not just hammer-ons/pull-offs/slurs that are going to give that kind of trouble. Playing across strings means many notes start before the previous one has significantly decayed. ...... and, of course, its only an electric guitar played through a dirty channel which is played note by note. Steve