Saturday, April 24, 2010

DC Block Digital Filter Simulations

Progress was made in regard to implementation of the DC Blocker and detector. As explained previously, we want to take full advantage of the ADC so we use a PGA to provide a variable gain. The PGA operates on a reference DC bias of 2.5v and provides gain to any AC on this DC line. However, the signal that arrives from TIA and after S/H circuit has some random nonzero DC bias associated. This DC bias needs to be detected and removed to analyze just the AC component.

While an analog filter could be used to remove the DC, an analog circuit would have to be developed to detect DC bias. A better solution is to implement a digital filter on chip. This was accomplished with minimal experience with DSP. An IIR filter was simulated first in MATLAB to quickly analyze and confirm results. Then the solution was transfered to a LABVIEW environment as will eventually be encapsulated as a Sub-VI for integration in full software.

DC removal transfer function:
DC Tracking transfer function:

To simulate with MATLAB the transfer function was implemented in the 1D filter function. A link is provided below.

Figure1,2: Random 1 volt bias applied with DC tracking no noise. Random 2.3 volt bias applied with some noise.
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/filter.html

Next, I worked to implement this in the LABVIEW environment. I ran into early problems with lack of documentation. I desired a solution as simple as MATLAB's 1D filter function that allowed me to simply specify filter transfer function coefficients. Most IIR filter examples I found for LABVIEW were about using Elliptical, Butterworth, etc. filters. I did finally find a control 'IIRFilter' that allowed me to specify forward and reverse coefficients. The result is presented below.


I wanted to leave some space to discuss issue of precision. MATLAB and LABVIEW allow for 64-bit double precision. But on a DSP chip the precision might be much lower. Our design was simple enough with a low precision coefficient (alpha=0.9). I will comment in more detail on this in a later post.

No comments:

Post a Comment