Skip to main content

FilterIO

Namespace: UTILSLIB  ·  Library: Utilities Library

#include <utils/filterio.h>

class UTILSLIB::FilterIO

Processes txt files which hold filter coefficients.

Processes txt files which hold filter coefficients.

src/examples/ex_dsp_filter/main.cpp
QTemporaryDir dir;
const QString path = dir.filePath("lp40.txt");
FilterKernel reloaded;
const bool written = FilterIO::writeFilter(path, lowPass);
const bool read = FilterIO::readFilter(path, reloaded);

Public Methods​

FilterIO()​

Constructs a FilterIO object.


Static Methods​

readFilter(path, filter)​

Reads a given txt file and scans it for filter coefficients.

Pls see sample file for file syntax.

Parameters:

  • path : QString holds the file path of the txt file which is to be read.

  • filter : FilterKernel & holds the filter which the read parameters are to be saved to.

Returns:

  • bool — true if reading was successful, false otherwise.

writeFilter(path, filter)​

Writes a given filter to txt file .

Parameters:

  • path : const QString & holds the file path of the txt file which is to be written to.

  • filter : const FilterKernel & holds the filter which is to be written to file.

Returns:

  • bool — true if reading was successful, false otherwise.

Example​

Authors of this file​