Went back to the #HaarWavelets stuff and found a way to control the rhythmicality of the noise by scaling the variances of the seeding decorrelated gaussian random numbers. With sigma = 1 it's rhythmic, smaller is more uniform. Maybe I could control it per octave instead of all octaves together in unison.
Now I'm thinking of combining this with the FFT-based stuff: X would be the 10D (real; usually 11D but I think it's maybe best to exclude DC for this) energy per octave analysis of the same audio that Y is the 128D (complex, excluding DC) FFT analysis of, then I can simulate X with #VectorAutoRegression like the attached (without generating audio) and feed that into the #VARMA to get Y for audio output.
#HaarWavelets #VectorAutoRegression #VARMA
Finally got the #Spectrum rendering mode for #Harry that I started in December working (almost) properly. It uses #HaarWavelets to estimate #EnergyPerOctave quite cheaply (and nastily). The bugs were:
- `haar[0][i] = haar[0][i];` (the second 0 should be 1)
- scaling by `1/sqrt(2)` (scaling by `1/2` looks much better for a sine sweep - not sure what is really "correct")
- plotting `->rms` instead of `->spectrum` (completely the wrong data, probably read out of bounds, explains some crashes)
- flipping the octaves vertically
- plot RMS for each octave, scaled by the number of octaves (plotting dB didn't work out so well)
Still to do before push:
- zoom in too much in the spectrum display and it goes blank. the fix will be to clamp zooming so you can't do that. will need to zoom out automatically when switching from waveform display to spectrum display, if it's too zoomed in
- the spectrum display judders up and down when you resize the terminal and sometimes overlaps the info text at the top
#spectrum #harry #HaarWavelets #EnergyPerOctave