Picture of Sound - Parallax Propeller P2 as a Tool to Analyse a Guitar Effect Pedal or an Amp
For this project P2 was chosen, because
- it's built in programmable gain ADC makes it simple to sample audio in a broad range of amplitude levels with acceptable signal to noise ratio. Only very simple additional hardware is needed.
- it has multiple cores, which make it simple to generate and sample audio in parallel and even have life VGA graphic output.
- sufficient RAM for buffers and for a 640*360 resolution picture with 256 colors.
- it's cordic solver is usable for hardware multiply, divide and hardware sine generation. For the display it's log is handy.
How does it work?
P2 is under control of Taqoz Forth which provides it's interactive user interface via terminal.
A sine signal of known frequency and amplitude is generated and fed into the device under test.
The devices output is sampled and analysed using a Goertzel algorithm, similar to fft, to get the magnitude of the test frequency and its 2nd and 3rd harmonics together with the overall amplitude. Each combination of test amplitudes with test frequencies builds the basis of one square data point and many of them build the diagram.
P2 prints the values after Goertzel analysis to serial terminal Teraterm in csv format. A Python script using numpy and matplotlib is used to generate the final picture.
What's in the Picture-of-Sound diagram?
- The horizontal axis is the test frequency in Hz, which is also the base frequency for the analysis.
- The vertical axis is the output amplitude of the device in mV-peak-peak.
- The numbers 9, 14, 19, 28, .... 886 within the diagram on the left side are the test amplitude levels in mVpp. So the test levels range from 9mVpp....886mVpp.
- The dotted lines give the frequency responses as amplitude in mVpp. Each line uses the same test level in mVpp as input to the device.
- If the dotted lines come together more closely, there is compression of volume levels.
- The size of the squares give the sum of the 2nd+3rd harmonic's magnitudes in relation to the base magnitude in percent. This represents the amount of harmonic distortion.
- The color of the squares give (2nd-3rd)/(2nd+3rd) the relative amount of the 2nd or the 3rd harmonic. This is interesting, because the 2nd harmonic is just the octave, which will make the sound "rich", while the 3rd harmonic will give a more aggressive sound.
So in the picture above, we can see, that there is emphasis of frequencies around 500Hz. At low levels 2nd harmonics are present and dominating, while at high input levels 3rd harmonics take over.
This is an analysis of an effect called ZEN. https://www.musikding.de/docs/musikding/zen/ZenV2_schalt.pdf The 2nd harmonics are generated by the asymmetric soft clipping around D1, D2, D3 in the schematic.
To show something different, this is the Picture of a Zoom Marshall MS1959 ("This models the sound of the Marshall 1959 SUPER LEAD 100") and it's 4*12 Stack:
Thanks to many people here: Peter for Taqoz Forth, Bob for it's documentation, ManAtWork and ErNa for the Kiss board. Evanh and all the others for insight into P2...
If you are interested in the results and more pictures, you are welcome to join in at: https://www.musikding.rocks/forum/index.php?thread/420821-picture-of-sound-make-visible-the-behaviour-of-an-overdrive-or-an-amp/#post451686
Have Fun, Christof