Under, perfect, and over sampling a function and zero-order hold interpolation
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nathan A Scott
el 25 de Jun. de 2021
Editada: Swetha Polemoni
el 2 de Jul. de 2021
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);
0 comentarios
Respuesta aceptada
Swetha Polemoni
el 2 de Jul. de 2021
Editada: Swetha Polemoni
el 2 de Jul. de 2021
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);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Interpolation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!