Skip to content

Commit e24db01

Browse files
authored
Update frequency_domain.rst (#162)
extent argument in plt.imshow expects a tuple, not a list. Even though the code will run with list, tuple is what it expects.
1 parent 0aa9b4d commit e24db01

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/frequency_domain.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ In Python we can generate a spectrogram as follows:
498498
spectrogram[i,:] = 10*np.log10(np.abs(np.fft.fftshift(np.fft.fft(x[i*fft_size:(i+1)*fft_size])))**2)
499499
500500
# Time starts at the top and goes down, eg sample x[0] will be part of the top row displayed
501-
plt.imshow(spectrogram, aspect='auto', extent = [sample_rate/-2/1e6, sample_rate/2/1e6, len(x)/sample_rate, 0])
501+
plt.imshow(spectrogram, aspect='auto', extent = (sample_rate/-2/1e6, sample_rate/2/1e6, len(x)/sample_rate, 0))
502502
plt.xlabel("Frequency [MHz]")
503503
plt.ylabel("Time [s]")
504504
plt.show()

0 commit comments

Comments
 (0)