I have some .wav files of heart sounds. I want to apply band-pass filter [20Hx 100 Hz]. Then generating PCG images size of 560x420 pixels and RGB format. How could i do this? Any help will be highly appreciated.
Using scipy you can easily:
- bandpass signals, for instance with scipy.signal.butter
- obtain a spectrogram, using for instance scipy.signal.stft (or LTFAT, The Large Time-Frequency Toolbox (LTFAT) in Python)
- scale the values of this 2D array so that each channel has values between $0$ and $1$
- reshape the array into a $560\times 420$ grid, eg with scipy.ndimage.affine_transform or scipy.ndimage.geometric_transform
- save the image, but I don't know the PCG format