The FIR Filter block in Tesira implements a filter that is defined by the FIR coefficients that are loaded into it. FIR coefficients can be stored in either a .wav file format, or a plain-text .csv (comma-separated values) format.
A handy tool for FIR filter design can be found here: http://t-filter.engineerjs.com/ and another here: https://www.arc.id.au/FilterDesign.html
- You can copy the output values from t-filter.engineerjs.com and paste as text into Excel (click in cell, right-click, select "Paste Special...", then select As: Text, and OK) then follow the directions below to format the csv file.
- Output from arc.id.au has the correct comma after the value but you will need to strip the leading and trailing braces.
This article describes how to properly format an Excel file to output a .csv file for Tesira's FIR filter.
Save as .csv file
When you save an Excel spreadsheet as a .csv file, the program will separate values in adjacent cells (horizontally) by commas, and it will separate values in different rows (vertically) with a line feed or line break.
Tesira's FIR Filter block expects all coefficients in the .csv file to be separated by commas, whereas line feeds and line breaks in the .csv file are ignored by Tesira software.
Values arranged horizontally in a single row
If all of your values in Excel are in in the same horizontal row, with 1 unique value per column, then there is no trouble. Each value will automatically get a comma placed between it and the next value. Simply do a Save As file type .csv.
Values arranged vertically in a single column
If your FIR coefficients are arranged in a single column (separate rows, or list-view style) then each value will get a line break, but no comma, after it when the .csv file is created. Tesira will not recognize this formatting.
Excel won’t place a comma after the values in a single column list view unless you add a single quotation mark (‘) in the second column, adjacent to each value in the first column. The easiest way to add a ' (single quotation mark) in all cells of the second column is as follows: put a ' (single quotation mark) in the first cell of the second column; select that cell and all cells below it which are adjacent to your coefficient values in the first column; then "Fill Down" to place the quotation mark alongside all of the coefficient values. You can then Save As file type .csv.
The quotation mark will create a 2nd value in each row, forcing a comma, but there will be no new data added. The line feed is ignored by Tesira and the next coefficient value is read.
If you open the .csv file in a text editor (like Notepad), you can see whether there is a comma after each value or not. If there are no commas, Tesira will not recognize the items as discrete values and will return an error.
Import .csv file
To import the .csv file into Tesira, create a new FIR Filter block in your Tesira file, and choose your .csv file when prompted:
There are a few additional restrictions on FIR coefficient files:
- The FIR coefficient file must contain a minimum of 4 coefficients.
- The FIR coefficient file cannot contain more than 2,048 coefficients.
- Each coefficient must be a decimal number between -1 and 1.
If any of the above conditions are not satisfied, you may see an error when you try to insert the FIR Filter block: