fastlib / fCWT

The fast Continuous Wavelet Transform (fCWT) is a library for fast calculation of CWT.
Apache License 2.0
263 stars 53 forks source link

Generate fCWT for a short signal to be used as feature #59

Open prashant-saxena opened 6 months ago

prashant-saxena commented 6 months ago

Hello, At present, I'm using MFCC as a feature in my CNN project. I'm also trying several other features to improve the prediction factor. The input data is a mono, 16Hz wave file. The data is extracted for 0.1 seconds.

signal, sr = librosa.load("test.wav", sr=None)
fs = 1600
f0 = 1 # lowest frequency
f1 = 101 # highest frequency
fn = 20 # number of frequencies
# Calculate CWT without plotting...
freqs, out = fcwt.cwt(signal[0:1600], fs, f0, f1, fn)
print(freqs)

The above code is generating freqs with 20 points but I'm a bit confused about fs, f0, and f1. The plot looks blurry and I believe that I haven't used correct values. How do I improve the freqs to have good noise for better predictions?

lschneiderbauer commented 4 months ago

You probably need to play with the sigma parameter (see the C++ example in the README). However, I don't know if the python interface exposes that option.