Design a digital filter using FDA tool (MATLAB function) for Delphi Programming

Digital filter is an important part of the digital signal processing. In order to design a digital filter, we need to calculate the filter coefficients. One of many tools that we can use to calculate the filter coefficients is by using the MATLAB function; ie FDAtool. Here step by step to calculate the filter coefficient and how to implement it to the Delph programming.

  1. Type fdatool in the command window of MATLAB
  2. Follows the response type, design method, filter order and specifications
  3. Click on the design filter button to generate the filter coefficients, and the filter coefficients are shown as follows:
  4. To convert four section of block filter to one section, you can use function Convert to Single Section on Edit menu.
  5. Here the example of the filter coefficients of one section
  6. Export the coefficients to the MATLAB cell so that we can easily copy and paste on main menu File.
  7. Click on the MATLAB cell on den and num variable to copy and paste
  8. Put the coefficients in the Delphi programming to develop the digital filter
  9. Here the example of digital filter implementation using IIR filter
  10. Here the result of the original and filtered signal
  11. Artificial sinus generator

Using Microsoft Excel for calculating the FFT

Fast Fourier Transform is an algorithm that is used to convert the signal in the time domain to the frequency domain. Thus, in the frequency domain, we can find the frequency component that exists in the signal. In this tutorial, we will show you how to use the Microsoft Excel to do the process. Following are the step by step of the FFT using Excel.

  1. Lets we generate the artificial sinus with a particular frequency, for example, the frequency is 100 Hz, and frequency sampling is 1000. In this case, the sampling frequency has comply the Nyquist rule. Type this formula to the excel cell and drag down to 1024 sample. [=sin(2*3.14*100*A2) ]
  2. Use Data Analysis tool in the Microsoft Excell as shown in the following figure to generate the imaginary and real value of the signal

3. After generates the FFT complex, we then calculate the magnitude and frequency component. Type following function in cell D2 =2/1024 * IMABS(E2) and drag up to 1024 cell to calculate the FFT Magnitude. Type following function in cell C2 = 0 and C3 = 1000/1024 ( 1000 indicates the sampling frequency and 1024 in order of FFT), to generate the increase value in the following cell use the series function as follow

4. In order to generate the artificial sinus signal use cell A and B as depicted as following 5. The spectrum of signal can be generated using cell C and D as shown in following figure

Source excel file:FFT with excel