Question

Hello, I have questions on Matlab. Let's say that I have an equation. Signal x(t)= cos(2*pi*10*t)...

Hello, I have questions on Matlab. Let's say that I have an equation. Signal x(t)= cos(2*pi*10*t) is sampled at sampling frequency of Fs=100 Hz. How do I both Upsample and downsample this frequency by a factor of 2 in Matlab? I need to see the code and how the graphs look. Thank you for the help.

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

Note: Done accordingly. Please comment for any problem. Please Uprate. Thanks

In matlab we have :

upsample

Increase sample rate by integer factor

downsample

Decrease sample rate by integer factor

Code:

Fs = 100;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*10*t);
y = upsample(x,2);
y2= downsample(x,2);
subplot(3,1,1)
stem(t(1:50),x(1:50),'filled','markersize',3)
grid on
xlabel 'Sample number',ylabel Original
subplot(3,1,2)
stem(t(1:50),y(1:50),'filled','markersize',3)
grid on
xlabel 'Sample number',ylabel UpSample
subplot(3,1,3)
stem(t(1:50),y2(1:50),'filled','markersize',3)
grid on
xlabel 'Sample number',ylabel DownSample

Add a comment
Know the answer?
Add Answer to:
Hello, I have questions on Matlab. Let's say that I have an equation. Signal x(t)= cos(2*pi*10*t)...
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