SarthakYadav / leaf-pytorch

PyTorch implementation of the LEAF audio frontend
64 stars 10 forks source link

Does the code process the signal and implement the window function? #8

Closed danyow-cheung closed 10 months ago

danyow-cheung commented 1 year ago

I am reading some paper saying ,before changing the signal into the feature images,they were using window function.I am wondering is it also in this code repository . I searched the raw_dataset.py. raw_transforms.py and train.py, but i coudn't find where to change signal.

btw,in the raw_transforms.py ,class Compose ,is it 's input is a image?still the same question,where you change the signal express

SarthakYadav commented 10 months ago

Sorry for the late response. When extracting spectrograms or other fixed features from raw waveforms, windowing (such as hanning, hamming windows) is applied for several reasons (primarily to avoid edge artifacts).

LEAF and SincNet are "learnable" features for audio. Windowing is not applied in either. Since the kernel is learned during training (and is not fixed), windowing is not necessary.

Hope that helps.