Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHi Dave,
I did what you suggested and modeled the lock-in amplifier in matlab (floating & fixed point). The results of both are the same =). but I found several problems which I didn't expect before. 1st, 40MSPS is too high to design a good LPF if my frequency of interest is 154khz. so I adjusted the sampling frequency to 4MSPS. 2nd, the paper& slides are very helpful, thanks! but i got a lil confused about the Q0.N representation. The product of two Q0.N (actual bit is 1+0+N=N+1) number is Q0.2N (1+0+2N)? maybe it actually means Q1.2N, there are 1 signed bit, 1 bit for whole and 2N bit for fractions. 3rd, after convolution, besides LSBs, I also need to cut some MSBs too right ? 4th, I used fdatool in matlab for fixed point coeff. there is one option 'set quantized parameter' where I specify the bit width of input, coeff and output. but I still need to round the exported coeffs into fixed point integers right? I attach my matlab code here (only the fixed point), I explained every step I did in the comments. could you please take a look and tell me if I did right? Thanks! Allison