Under, perfect, and over sampling a function and zero-order hold interpolation

32 次查看(过去 30 天)
the signal is x(t) = sin(200*pi*t) and i need to generate samples for under, perfect and over sampling
After that i need to use zero-order hold interpolation to generate 1000 samples
Mainly do not understand how to determine how the frequency varies between the sampling, as of right now im just throwing random frequencies in there and just seeing what looks right. Then in regard to the zero-order hold interpolation I have never used this before and do understand what i need to type into the code.
this is the code that i have for the sampling currently
Under:
f = 100;
p = pi;
t = 0:1/f:1;
x = sin(200*p*t);
figure(1);
stem(t,x);
Perfect:
f2 = 201;
t = 0:1/f2:1;
x = sin(200*p*t);
figure(2);
stem(t,x);
Over:
f3 = 300;
t = 0:1/f3:1;
x = sin(200*p*t);
figure(3);
stem(t,x);

采纳的回答

Swetha Polemoni
Swetha Polemoni 2021-7-2
编辑:Swetha Polemoni 2021-7-2
Hi,
For a signal sin(2*pi*fm*t) , fm is its frequency. To sample this signal replace t = N*Ts. where N is an integer and Ts is sample period. fs = 1/Ts is sampling frequency.
For perfect sampling fs = 2*fm . This implies Ts = 1/2*fm
For under sampling fs < 2*fm . This implies Ts > 1/2*fm
For over sampling fs > 2*fm . This implies Ts < 1/2*fm
N = 1000 % number of samples
n = 0 : Ts :N*Ts % choose Ts based on equation and inequations for each sampling
x = sin(2*pi*fm*n);
In this documentation setinterpmethod you can find an example to use zero order hold interpolation.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by