// The last sample of the output data will represent the frequency
// that is 1/4th of the input sampling rate. For example,
// if the input wave data is sampled at 44,100 Hz, then the last
// sample of the spectral data output will represent the frequency
// 11,025 Hz. The first sample will be 0 Hz; the frequencies of
// the rest of the samples vary linearly in between.
// Note that since human hearing is limited to the range 200 - 20,000
// Hz. 200 is a low bass hum; 20,000 is an ear-piercing high shriek.
// Each time the frequency doubles, that sounds like going up an octave.
// That means that the difference between 200 and 300 Hz is FAR more
// than the difference between 5000 and 5100, for example!
// So, when trying to analyze bass, you'll want to look at (probably)
// the 200-800 Hz range; whereas for treble, you'll want the 1,400 -
// 11,025 Hz range.
// If you want to get 3 bands, try it this way:
// a) 11,025 / 200 = 55.125
// b) to get the number of octaves between 200 and 11,025 Hz, solve for n:
// 2^n = 55.125
// n = log 55.125 / log 2
// n = 5.785
// c) so each band should represent 5.785/3 = 1.928 octaves; the ranges are:
// 1) 200 - 200*2^1.928 or 200 - 761 Hz
// 2) 200*2^1.928 - 200*2^(1.928*2) or 761 - 2897 Hz
// 3) 200*2^(1.928*2) - 200*2^(1.928*3) or 2897 - 11025 Hz

// A simple sine-wave-based envelope is convolved with the waveform
// data before doing the FFT, to emeliorate the bad frequency response
// of a square (i.e. nonexistent) filter.

// You might want to slightly damp (blur) the input if your signal isn't
// of a very high quality, to reduce high-frequency noise that would
// otherwise show up in the output.

In simple words it is the non normalized values of signal strength for frequencies from 0-11 KHz (in case if you have 44KHz sampling). Number of intervals depends on number you supply as 3-rd parameter to SpectrAnalyzer. Note that in many cases supplying 512-576 is the best choice for that parameter. In that case first returned value from asFrequencies() will represent strength for 0-20 Hz, second 20-40 Hz etc.

So, I am also trying to use the SpectrAnalyzer in my program, in order to analyze sound files and determine whether they are major, minor, etc, yadda yadda yadda what it really boils down to is am I right in thinking that the numbers output by the asFrequencies function represent the amplitude of the frequencies in that band (given that the frequency range is 200 to 1/4 the sampling rate or usually 11025 and is divided by the number of bands as provided in the arguments for the function)? So if I wanted to be able to identify every note present, I should figure out what the frequency margin of error for intonation of a note is and thus figure out how many bands I would need, and plug that in, and those bands that were not negligibly low I should identify as notes? I'm hoping to be able to get my code functional and finished without ever having to print anything to see what it is, because I tried that with a full band arrangement of Pachelbel's Canon and the SpectrAnalyzer printed so much that viewing it in the Shell crashed python. I think if I don't print it it won't crash python.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum