LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exportting filter coefficients to text file

Solved!
Go to solution

Emad_NRIAG_0-1756074315519.png

Emad_NRIAG_0-1756074595615.png

 

I want to export the filter coefficients from multistage Decimation Filter design from all filter stages to a text file or csv file.

0 Kudos
Message 1 of 11
(286 Views)

Please help us help you.  I'm unaware of the Multistage Decimation Filter express VI.  You also didn't provide anything more than a very limited picture of this function.

  • Where can I find this Express VI?  Is it included in a standard LabVIEW installation, or does it require a specialized Package?
  • It looks like the wire coming out of the Express VI might be a Cluster.  Why not attach an Indicator to it and show us what the Indicator looks like?  I'm going to guess it might actually be a more complex Indicator, perhaps an Array of Clusters if there are multiple components of this filter.
  • To parse Arrays, simply take the Array wire into a For Loop to get out the Array Elements one at a time.
  • If a component is a Cluster, doing an "Unbundle by Name" will identify the sub-components.
  • Ultimately, it is your responsibility to decide how you want to handle and deal with the data contained in the Wire.

To get more targeted help, attach working LabVIEW code (preferably in "not the latest version of LabVIEW", but maybe in LabVIEW 2021 (Save for Previous Version) that includes real data saved in a real Indicator (so we can see and learn something about the data you are dealing with).

 

Bob Schor

Message 2 of 11
(261 Views)

Great Thanks, Mr. Bob Schor for your cooperation.


The Express VI location is as follows:
Signal Processing >>>Digital Filter Design>>> Multi-rate design >>> DFD N stage M rate filter design.vi.

 

more information can be found in this link:
https://www.ni.com/docs/en-US/bundle/lvdfdt-api-ref/page/vi-lib/addons/digital-filter-design/express...

Kindly, download the attached LabVIEW code.

 

Great Thanks

0 Kudos
Message 3 of 11
(224 Views)

One easy way is to flatten it to XML and write it to file.

Yamaeda_0-1756124414018.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 11
(213 Views)

I am sorry, but I don't have the Digital Filter Design toolkit installed, so I cannot help you with designing a multi-stage, multi-rate decimation filter.  Most of my work involves frequencies in the "biological" range, not-so-many kHz and simple filters.  I hope @Yamaeda's response is more helpful to you.

 

Bob Schor

0 Kudos
Message 5 of 11
(197 Views)
Solution
Accepted by Emad_NRIAG

Yameda has the smart and complete solution,

 

if you only want the FIR values try 

CIC dec filter coef write to txt.png

 

well, the bottom loop 😉

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 11
(194 Views)

Thanks a lot, Mr. Yamaeda, but the easy methods probably don't work fine for this complex filter.

I tried your solution, but the output file does not provide the coefficients correctly.

It’s expected that stage one gives 34 coefficients, stage two gives 8 coefficients, and stage three gives 658 coefficients.

0 Kudos
Message 7 of 11
(190 Views)

Great Thanks, Mr. Bob Schor. I shall need you help in other fields 🙂

0 Kudos
Message 8 of 11
(184 Views)

Great thanks, Mr. Henrik, for your brilliant solution. I really appreciate your help.

 

 

 

 

Greetings from Egypt
Emad

0 Kudos
Message 9 of 11
(179 Views)

@Emad_NRIAG wrote:

Thanks a lot, Mr. Yamaeda, but the easy methods probably don't work fine for this complex filter.

I tried your solution, but the output file does not provide the coefficients correctly.

It’s expected that stage one gives 34 coefficients, stage two gives 8 coefficients, and stage three gives 658 coefficients.


It seems to have 1 extra, searching for Dimsize you get 35, 9, 659. I don't know anything about the method, but that's what's generated. The main point is that it's easy to check the file (as it's text) and read back if you want to continue the next day.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 11
(161 Views)