我已使用脚本在2d中从文件data
创建了频谱图
Pxx, freqs, bins, im = plot.specgram(data, NFFT=524288, Fs=2.5e9, noverlap=65536, cmap='plasma')
plot.colorbar(label='Voltage (dB)').ax.yaxis.set_label_position('left')
ax = plot.gca()
ax.set_title('Night sound spectrogram detection')
ax.set_xlabel('Time (s)')
ax.set_ylabel('Frequency (Hz)')
plot.show()
问题是如何创建3d频谱图?
我尝试过
spec = plot.figure()
ax = spec.gca(projection='3d')
ax.plot_surface(frequs, bins, Pxx, cmap='plasma')
plot.show()
但它不起作用。