Question

Question 6: We will consider a piece-wise constant 1D signal in this part. Assume the signal (a function f(t)) contains S = 1Question 9: Write a function named signaldenoiser that takes the noisy 1D array and the number of subintervals as inputs and

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#please ask 1 question at a time

#i have done 6th and 7th since they were similar

#question 6
import matplotlib.pyplot as plt#dont include this line if already imported

plt.subplot(1,2,1)
plt.plot(sampling_locations,signal)
plt.xlabel('Sampling Locations')
plt.ylabel('Signal')
plt.title('Simple line plot')

plt.subplot(1,2,2)
plt.stem(sampling_locations,signal,use_line_collection=True)
plt.xlabel('Sampling Locations')
plt.ylabel('Signal')
plt.title('Stem plot')
plt.tight_layout()
plt.show()

#question 7
import matplotlib.pyplot as plt#dont include this line if already imported

n=len(signal)
mu = 0 # mean
sigma = 3 # standard deviation
noise = np.random.normal(mu, sigma, n)
newSignal = signal+noise
plt.subplot(1,2,1)
plt.plot(sampling_locations,newSignal)
plt.xlabel('Sampling Locations')
plt.ylabel('Signal with noise')
plt.title('Using Plot')

plt.subplot(1,2,2)
plt.stem(sampling_locations,newSignal,use_line_collection=True)
plt.xlabel('Sampling Locations')
plt.ylabel('Signal with noise')
plt.title('Using Stem')
plt.tight_layout()
plt.show()

Add a comment
Know the answer?
Add Answer to:
Question 6: We will consider a piece-wise constant 1D signal in this part. Assume the signal...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT