F
Francesco Poderico
Hi all,
I'm trying to design a DIY oscilloscope that can be connected with a PC and I want to be able to display signal at frequency as higher I can... (in theory fs/2).
I'm sampling at 100 MSPS with an 8 bit ADC, 45 MHz bandwidth. Eventually my plan is to achieve 200 MSPS.
I'm having problem trying to interpolate the input data from a 2 kbyte buffer and
please visit my blog to see the problem: http://thefpproject01.blogspot.co.uk/
now in my blog I have attached 2 picture that shows why I believe my interpolation algorithm is not working...
I rewrite the function for clarity.
function sinc_interpolation(buff: TCH_BUFF; Fsample: float; t: float): float;
var
i: integer;
sum: float = 0;
x_nt: float;
Ts: float = 0;
begin
{
x(t) = sum [ Xn sinc(pi/T(t-nT))] sum all the n...
}
Ts := 1 / FSample; // sample time
sum := 0;
for i := 1 to BUF_SIZE - 2 do // remember to fix the bug inside the FPGA
begin
x_nt := buff * sinc((t - i * Ts) / Ts);
sum := sum + x_nt;
end;
Result := Sum;
end;
WHat am I doing wrong?
Thanks,
Francesco
I'm trying to design a DIY oscilloscope that can be connected with a PC and I want to be able to display signal at frequency as higher I can... (in theory fs/2).
I'm sampling at 100 MSPS with an 8 bit ADC, 45 MHz bandwidth. Eventually my plan is to achieve 200 MSPS.
I'm having problem trying to interpolate the input data from a 2 kbyte buffer and
please visit my blog to see the problem: http://thefpproject01.blogspot.co.uk/
now in my blog I have attached 2 picture that shows why I believe my interpolation algorithm is not working...
I rewrite the function for clarity.
function sinc_interpolation(buff: TCH_BUFF; Fsample: float; t: float): float;
var
i: integer;
sum: float = 0;
x_nt: float;
Ts: float = 0;
begin
{
x(t) = sum [ Xn sinc(pi/T(t-nT))] sum all the n...
}
Ts := 1 / FSample; // sample time
sum := 0;
for i := 1 to BUF_SIZE - 2 do // remember to fix the bug inside the FPGA
begin
x_nt := buff * sinc((t - i * Ts) / Ts);
sum := sum + x_nt;
end;
Result := Sum;
end;
WHat am I doing wrong?
Thanks,
Francesco