# Reconstruction of a signal using an ideal DAC

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]

• You need to apply sinc interpolation: en.wikipedia.org/wiki/…
– MBaz
Dec 5 '17 at 17:10
• Would you mind providing me with an idea of how to apply that to my question, thank you. Dec 5 '17 at 17:47

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.
• +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)$. Dec 6 '17 at 16:01