Harmonic

BPF bank analysis Spectrogram

Spectrogram analysis of Tube Amplifier Distortion (PC simulation)

github repository

feature

description

analysis of Tube Amplifier Distortion (PC simulation)

Input signal is 1KHz -10dB sin wave

FFT spectrum of 1KHz-10dB_44100Hz_400ms-TwoTube_stereo.wav. There are 2nd harmonic(2KHz) and 3rd harmonic(3KHz).
figure_input1

BPF_analysis1.py output. Dark white line in the mid area shows 2nd harmonic(2KHz). Bright white line shows 1KHz.
Start wave pattern is filter transient response.
figure_input2

Input signal is mix of 400Hz -10dB sin wave and 1KHz -10dB sin wave

FFT spectrum of Mix_400Hz1KHz-10dB_44100Hz_400msec_TwoTube_mono.wav. There are 600Hz, 1400Hz, etc other than 800Hz, 2KHz, 1600Hz and 3000Hz.
figure_input3

BPF_analysis1.py output. Dark white lines show 600Hz, 1400Hz, and 2KHz.
figure_input4

Compare matching portion of two spectrograms

A music spectrogram comparison of input and output of Tube Amplifier (PC simulation).

Matching portion (red rectangle area) in the template spectrogram to compare.
Set diagonal position by pointing-device mouse and exist figure. Matching portion in the matching spectrogram will be detected by cv2.matchTemplate function.
figure_input5

each matching portion of template spectrogram and matching spectrogram
figure_input6

matching portion and its difference (red means positive and blue means negative)
figure_input7

Search some similar area near the specified area in spectrogram

Specify the area as diagonal position by pointing-device mouse. And then, click right mouse button or press m on keyboard.
figure_input8

Spectrogram, 2D FFT, and 2D inverse FFT

In the following figure, from top to bottom, spectrogram, 2D inverse FFT of red rectangle in 2D FFT, and 2D FFT of the spectrogram.

figure_input9

Search some similar area to the specified area in another channel spectrogram

Load stero(2 channel) wav file and make Spectrogram per each channel (show Figure 1 and Figure 2).
Search some similar area to the specified area in another channel.
Specify the area as diagonal position by pointing-device mouse. And then, click right mouse button or press m on keyboard.
figure_input10

After above completed, then press c on keyboard. It will compute difference between both channel, after time correction.
figure_input11
Peak or bottom in the difference, frequency characteristic between channels, is significant, because real signal is available at the point to be compared.

Accentuate ridge of local peak in lower frequency

BPF_analysis2.py was added simple moving average until 800Hz signal to accentuate ridge of local peak.
figure_input12

License

MIT

Regarding to nms.py, please refer copyright and license notice in the content.