Question: I am getting out graphs with no data on them, I was given guidance to flatten or use receptions [ 0 , : ] on

I am getting out graphs with no data on them, I was given guidance to flatten or use receptions[0,:] on the receptions but however I am doing it is not working.
Code so far.
import numpy as np
import matplotlib.pyplot as plt
npz_file = np.load('proj_part3.npz')
fs=npz_file['fs']
starttime=npz_file['starttime']
nreceptions=npz_file['nreceptions']
receptions=npz_file['receptions']
fc=npz_file['fc']
pulsetype=npz_file['pulsetype']
sigdur=npz_file['sigdur']
time_vector = np.arange(starttime, starttime + sigdur, 1/fs)
#receptions[0,:]
#receptions.flatten()
plt.plot(time_vector, receptions)
plt.title('Recieved Data vs Time')
plt.xlabel('Time (s)')
plt.ylabel('Recieved Data')
plt.show()
dB_dynrange=40
plt.figure(figsize=(10,6))
spec,freqs,tspec,im=plt.specgram(receptions, NFFT=256, Fs=fs, mode='magnitude', scale='dB', sides='twosided')
plt.colorbar(label='Magnitude (dB)')
plt.xlabel('Time (s)')
plt.ylabel('Frequency (Hz)')
plt.title('Two-Sided Spectrogram of Received Data')
plt.show()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!