Thank you for the clarification! I sensed this distinction but didn’t have any terminology for it.
That being said, these single cycle waveforms do have a length. So, while it’s not a spectrum plot of a single DFT, I’m imagining that they may look pretty similar regardless? Or am I way off there?
I guess one way to find out is to either write some code, or use yours (which I would personally appreciate greatly!)
they’re not really the same plots, though they show the same information (sort of.)
ffmpeg is using some fixed window size that i don’t know, call it N.
with the default orientation, each vertical slice of the image (one pixel? i dunno) represents the spectrum of a chunk of N samples.
to render the next vertical slice it looks at the next N samples, probably with some overlap factor (to improve time resolution without sacrificing frequency resolution.) additionally, it will be applying some kind of windowing function to eliminate artifacts arising from the truncation at the window boundaries. (the choice of the windowing function is a tradeoff between resolution and bin leakage.)
if your input signal happens to be N samples long, then yes, you should get a single vertical slice that has the same information as a spectrum plot, but the amplitude dimension is mapped to pixel color value (using some arbitrary palette) instead of to the Y axis. not as easy to read.
i’ll make a little thingy while i happen to be on this task
Yeah, I was trying to figure out the terminology of how to say I only wanted an axis for amplitude and an axis for frequency and show results for the length of entire, tiny file. And then not have them expressed in gradients for clarity. Thanks @zebra for that explanation and for your assistance, looking forward to the thingy!
In the meantime @jasonw22 I tweaked your script with the following arguments:
Then I stopped at the script that desaturated things as it basically wiped everything to black. I instead used batch processing in photoshop that used a levels curve to make a decent non-gradient version. Looks pretty close to what the other AK images look like. I imagine it’s not very accurate, but at least gives an approximation of what to expect from the single-cycles.
Curious to see the results from @zebra in comparison
yeah sorry, that is a bug. actually fixed now, but not in the binary
i’ll finish up lin/log scaling and upload another. though on looking i think the AKWF images are using linear frequency scaling. i guess that makes it easier to identify harmonic series, but maybe a little harder to grok the spectral distribution as a whole - particularly without labels on the frequency axis.
logarithmic frequency scaling is now the default and the height argument works. NB that the order of arguments has changed.
to force linear scaling, enter “lin” in the 3rd argument (case sensitive)
for example, with lin scale and height=120px:
wavespecter input.wav output.png lin 120
if you want log scaling and also want to specify a height, put whatever in the 3rd argument:
wavespecter input.wav output.png logabloobloo 120
PS. i know this argument parsing system is stupid. on *nix i would usually use getopt. but i don’t know a good/easy way of doing that for windows as well, didn’t want to look too hard, and definitely don’t want to roll my own. (anyone have an idea?)
PS.2. i had a moment of self-inflicted mindf*ckery trying to decide how people deal with DC in a log frequency scale. i decided not to worry about it, assume that zero in = zero out, and start interpolating from the first non-zero index. copious code commenting ensued. (anyone have another idea?)
PS.3. if you want to do a lot of batch image processing (say, rescaling) it could be worth learning a bit of imagemagick (fair warning - that shit gets deep.) but whatever works of course.
I just wanted to pick up on this comment, and point out that the easy way to get a Python install with support for numerical/scientific computing these days is to grab a build from Anaconda.org.
totally true, but that’s exactly what i mean - anaconda is an absolutely massive environment, installs hundreds of packages, takes multiple GB of drive space, and i’ve seen its installer do very rude things to the bash environment. (at one place of work, i’ve taken to wrapping conda installs with docker to avoid linker problems later.)
yea, if you want to develop scientific programs in python that’s absolutely the easiest way to set it up, but i don’t recommend it for an end-user who just wants to run a program to do a thing, if the thing is pretty simple (and not some heavy machine-learning stuff that actually needs pytorch or something.)
Man, all this makes me want to redo everything I’ve done in the reference file, ha! But first I’m gonna clean up these new versions for the stereo folder, share it, then go from there.
If you’re gonna play with conda, might as well mess with Jupyter while you’re at it. Really nice REPL that can play nice with viz libs. Can also work with music21 for some algorithmic composition, with nice staff printing, etc. (that’s where I hope to merge musical and machine learning interests when I can find the time).
Shit gets deep any direction you look if you stare at it long enough
Finally found a free moment to run @zebra 's app on the stereo section’s waveforms and redo the layout for those pages. Turned out really sharp, almost makes me want to redo all the other sections the same way, but gotta get back to the music making side of things, haha.
Here’s the PDF if anybody is interested in it. It’s formatted to be printed single-sided on three hole punch paper because everyone has a reference notes binder, right? Right??
Oops, it’s too big for upload here, so here’s a WeTransfer link, I’ll find a permanent home for it later:
Once done, the link will be permanent.
It will be on a domain that I have named hsjp.eu and that I’m currently building. For now it contains only a small gallery of pictures as test. It will be a website shared by a friend and I who are both hobby musicians quite known on KVR and Audiofanzine.
Take your time, there is no hurry. I’ll recall you… hmm… at the end of the next week for example.