0

I want to print a spectrogram image for each time step

This is what i have tried

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

NFFT = 256     # the length of the windowing segments
Fs = 64  # the sampling rate


plt.subplot(212)  # don't share the axis

for x in range(1,20): 
  Pxx, freqs, bins, im = plt.specgram(a, NFFT=150, Fs=Fs,noverlap=50, cmap=plt.cm.gist_heat)
  NFFT = NFFT+50
  plt.savefig("spectrogram{x}.png".format(x=x))

But the output image for the first iteration is as same as the image in the last iteration

Hadeer Zayat
  • 61
  • 1
  • 8

0 Answers0