0

Haven't been able to find a clear answer on this. I'm interested in 75-500Hz bandwidth. It's for a tuner(android app) so i want a pretty quick response time.

Is it worth the computational time to high pass the signal?

Nick54321
  • 23
  • 3
  • do you want to detect a single sinusoid in this audio? dunno how HPF would speed things up. for pitch detection, i only HPF to block DC and then toss in some simple -6 dB/oct LPF to help emphasize the periodic portion and attenuate the crap. so for pitch detection of monophonic musical tones, i pass it through a BPF of low Q and a resonant frequency of about 20 Hz. – robert bristow-johnson Jan 18 '17 at 01:23
  • I'm trying to detect the pitch. I know the HPF will add computational time, I'm wondering if it's worth the time to filter out the DC and low frequency (<50 or 60Hz) components, or if its not really necessary – Nick54321 Jan 18 '17 at 02:30
  • 1
    DC blocking is useful in pitch detection. whether you are using some autocorrelation technique or zero-crossing, you need to get rid of DC from the signal if you're gonna be doing pitch detection. and any DC blocking filter is an HPF. and a gentle -6 dB/oct LPF is also useful for preserving periodicity while whacking some of the high-frequency components (that might be noisy). – robert bristow-johnson Jan 18 '17 at 02:41
  • dunno if you're using MATLAB or some other tool to quickly try things out, but take your monophonic audio (one note at a time, no chords), run it through a BPF with resonant frequency at 20 Hz and 1/2 < Q < 1. look at the waveform going in and coming out. the waveform coming out will look a lot better for determining its period. – robert bristow-johnson Jan 18 '17 at 02:46
  • im just designing what i want in matlab and implementing/testing in the app. I'm going to be using a frequency domain approach. I have a pretty aggressive LPF(but very linear in the BW im interested in) cutting off sounds higher than 1kHz. It's intended for a guitar so i thought removing high f components would help with spectral density accuracy. – Nick54321 Jan 18 '17 at 02:52
  • thanks for the DC blocker link, it looks effective and inexpensive. I'll be using it – Nick54321 Jan 18 '17 at 02:54
  • with floating point, you need not do all of that noise-shaping or error-shaping shit. but you should also LPF for smoothness. – robert bristow-johnson Jan 18 '17 at 02:59
  • My FFT seemed to be pretty noisy and the peaks were a little off when i tested it with pure sinusoids. So i made it an averaged periodogram(Welch's method), LPF'd the raw signal and it seems to be a bit better. I'm just trying to get it to be more accurate before trying pitch-detection algorithms. Havent done any noise or error shaping though. – Nick54321 Jan 18 '17 at 03:09
  • that noise-shaping in that DC blocker trick is because of a problem that crops up when using fixed-point arithmetic. don't bother with it if you're doing this in floating point. $$ $$ what do you mean by "trying to get it to be more accurate"? what is "*it*"? and what is this FFT all about? – robert bristow-johnson Jan 18 '17 at 03:34
  • after applying a DC-blocking HPF followed by a LPF with corner at about 20 Hz, then use something other than FFT for pitch detection. i would recommend something based on autocorrelation, AMDF, or ASDF. – robert bristow-johnson Jan 18 '17 at 03:38
  • Trying to get the FFT to more accurately represent the signals i'm interested in. I think its being messed with by noise.. And i'm using a FFT to get the spectral density of the signal, to then use a pitch-detection method to determine the note being played – Nick54321 Jan 18 '17 at 03:39
  • Really? That is surprising, i thought the best way would be to examine the frequency components, because that's what we're interested in. I haven't looked into it yet but i figured that since we're dealing with a fixed fundamental frequency that is correct I could hard code in some known pattern and compare to that. Not sure, checking out these other methods right now. – Nick54321 Jan 18 '17 at 03:48
  • the pitch detection and whatever spectral density are orthogonal problems. i would not use the LPF'd signal for your spectral density because you will see your spectral density die at a rate of -6 dB/oct faster than it really does. the DC blocking filter might be a good thing (but you can also fix that in the FFT results). also, make sure you window the time-domain data going into the FFT. need to have gracefully-tapered tails on the data going in. – robert bristow-johnson Jan 18 '17 at 03:48
  • check out "missing fundamental". in your pitch detector, you want to make as few assumptions as possible,. – robert bristow-johnson Jan 18 '17 at 03:49
  • I am making a guitar tuner for a project. I can get away with assuming there will be one note played at a time and that there wont be too much noise. I was thinking that once i get my spectral density to be fairly accurate I could just use something like the maximum liklihood method to figure out what the strings at, and compare it to what i want it to be at and control the tuner. These other methods seem better, but i'm trying to keep it as simple as i can – Nick54321 Jan 18 '17 at 04:13
  • tossing an FFT in there seems hardly simple – robert bristow-johnson Jan 18 '17 at 04:38

2 Answers2

1

Yes, it is. If you pickup signals with a microphone you will often see enormous amounts of low frequency signals (air condition, HVAC, traffic, wind, etc.). Even in quiet rooms there tends to be a lot of very low frequency noise.

This noise can dominate the time domain waveform and reducing it can often make your pitch detector more reliable and/or allows for a cheaper or more efficient algorithm.

Hilmar
  • 44,604
  • 1
  • 32
  • 63
0

The computational overhead of a band-pass or high-pass (DC blocking) filter on a processor capable of pseudo-real-time musical pitch detection and estimation accurate enough for tuning (+-1 cent?) is probably a small fraction of a percent.

hotpaw2
  • 35,346
  • 9
  • 47
  • 90
  • for 1st-order HPF or 2nd-order BPF, for sure. – robert bristow-johnson Jan 18 '17 at 03:00
  • haven't done that benchmark on my smartphone, but on single-board ARMv7-A with NEON extensions, people still do complex MS/s through dozens-of-taps FIRs, so I'm confident my 3x that clock rate, 4x the cores smartphone will be relatively fine at audio rates for more than first or second order BPFs, @robertbristow-johnson. – Marcus Müller Jan 18 '17 at 09:55