Under, perfect, and over sampling a function and zero-order hold interpolation
33 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nathan A Scott
le 25 Juin 2021
Modifié(e) : Swetha Polemoni
le 2 Juil 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 commentaires
Réponse acceptée
Swetha Polemoni
le 2 Juil 2021
Modifié(e) : Swetha Polemoni
le 2 Juil 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multirate Signal Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!