Re: Semitone Spectrogram
Posted: Thu Dec 31, 2015 11:29 am
Refer to Wikipedia's article on heterodyne. Basically what I do is the following;
1. For each note generate sine(wt) and cosine(wt) with the corresponding angular frequency w.
2. Multiply the input with sine and cosine, respectively.
3. Lowpass-filter products to remove the sum frequency and keep only the difference frequency components, call them x and y.
4. Evalueate x^2 + y^2 to get the squared amplitude of that semitone. Assumption is that within the semitone frequency band only one sinusoid is present else you get beats.
Note that in contrast to straight bandpass-filtering the input, with heterodyning you eliminate the need for an envelope follower.
1. For each note generate sine(wt) and cosine(wt) with the corresponding angular frequency w.
2. Multiply the input with sine and cosine, respectively.
3. Lowpass-filter products to remove the sum frequency and keep only the difference frequency components, call them x and y.
4. Evalueate x^2 + y^2 to get the squared amplitude of that semitone. Assumption is that within the semitone frequency band only one sinusoid is present else you get beats.
Note that in contrast to straight bandpass-filtering the input, with heterodyning you eliminate the need for an envelope follower.