How to write custom Dataloader for stft of time series

I have dataset of time series of length 3000 and total 75000 observations i.e. dataset of 75000*3000. The time series are divided into train, test and validation. I have to applied STFT for each time series to train CNN. How should i make custom Dataloader for this dataset.