1
$\begingroup$

enter image description here


I think I was able to do part (a) correctly, but now am stuck on part (b). I don't know how to approach this part or what is the theory behind it. My MATLAB code is shown below. Please let me know if I have any mistakes.

% part a
T = 0.2;
t = 0:0.001:3*T;
xc = 10 + 3*sin(20*pi*t+pi/3)+ 5*cos(40*pi*t);
% for sampling time t = 0.01n
n = 0:0.01:3*T;
xn = 10 + 3*sin(20*pi*n+pi/3)+ 5*cos(40*pi*n);
figure(1)
plot(t,xc);
hold on
stem(n,xn,'filled');

% part b
% constructing yr to produce x[n]
$\endgroup$
  • $\begingroup$ You need to apply sinc interpolation: en.wikipedia.org/wiki/… $\endgroup$ – MBaz Dec 5 '17 at 17:10
  • $\begingroup$ Would you mind providing me with an idea of how to apply that to my question, thank you. $\endgroup$ – Raykh Dec 5 '17 at 17:47
1
$\begingroup$

This is an ill posed question.

First it doesn't talk about the output DAC reconstruction sampling rate which is necessary for the reconstruction filter design and which also determines the frequency spectrum scaling of the reconstructed signal. Anyway then you may assume the DAC sampling-rate to be equal to ADC sampling rate for simplicity, which are both $F_s = 100$ Hz in your case. (btw your matlab code is wrong here, you have taken the sampling period to be $0.001$ which should be $0.01$.)

Furthermore, it talks about an ideal DAC which cannot be realized by any code, but, its output can be mathematically described perfectly without any computation by definition of the ideal DAC to be $$y_r(t)=x_c(t)$$ as long as there is no aliasing during the ADC stage which is the case here. So it's not clear if they want you to actually compute an approximate output $y_r(t)$ or simply evaluate the exact described output $x_c(t)$ in terms of input samples, which is a null computation.

$\endgroup$
  • $\begingroup$ Thank you for your answer @Fat32. But here is my problem, I don't really have a clear understanding of this at this point, some how it has been mentioned to me to interpolate using the sinc function do you know how to do that? $\endgroup$ – Raykh Dec 6 '17 at 0:12
  • $\begingroup$ @Raykh you may search the site for sinc and interpolate... There are implementations... $\endgroup$ – Fat32 Dec 6 '17 at 0:42
  • 1
    $\begingroup$ +1. I believe this is a non-realistic and idealized problem that one often finds in textbooks or is assigned as homework. IMO the author of this question is not expecting you to sinc interpolate nor write any code. You only need to notice that the sampling period is 0.01 s i.e. the sampling rate is 100 Hz and the largest frequency in $x_c(t)$ is 20 Hz. So Nyquist criterion is met and $y_r(t)$ will be identical to $x_c(t)$. $\endgroup$ – Atul Ingle Dec 6 '17 at 16:01
  • $\begingroup$ @AtulIngle that's also what I think so. However it's hard to be sure beforehand... $\endgroup$ – Fat32 Dec 6 '17 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.