Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gpuaudio/iir_processor

Repository files navigation

IIR Processor

Summary

The iir_processor is a infinite impulse response filter implementation in a GPU AUDIO processor. You can apply the processing on a file with up to 8 channels. Please note that the input channel count will match the output channel count of the audio file.

It allows you to apply a band-pass filtering to an arbitrary signal. Adjusting the settings of the filter is done through the initialization options from BG::Dsp::ProcessorSpecification.

preOne can:

  • change the sample rate used in the filter creation (a default of 96kHz will be assumed if none is passed)
  • change the band-pass frequency
  • change the quality factor

Project Setup

You should ensure that your CUDA_VERSION and CUDA_COMPUTE_CAPABILITY variables are correctly set up in CMakeLists.txt

Example Processor Launcher Config File

device: 0
processor: iir
options:
    sample_rate: 96000
    band_pass_freq: 4000
    band_pass_q: 0.5
input: test-signal.wav
output: output.wav

Initialization Options

  • sample_rate (float) : Sample rate of filter (Please note that you should match your signal's sample_rate in order to properly perform the processing)

  • band_pass_freq (float) : Center frequency of the IIR filter

  • band_pass_q (float) : Quality factor of the IIR filter

Usage

The sample_rate, band_pass_freq and band_pass_q can be manipulated through the ProcessorSpecification::options structure.

It is a key and value map passed during the processor's creation.

BG::Dsp::ProcessorSpecification spec;
spec.options = {{ "sample_rate", 96000 }, { "band_pass_freq", 4000 }, {"band_pass_q", 0.5}};
...
// the module interface is used to create a processor
BG::Dsp::Processor* processor = module->CreateProcessor(spec);

Host Code Components

IirModule

Implements the interface for the engine to create and destroy the processor.

IirDeviceCodeProvider

Provides the engine access to the device binary, which is embedded in the processor binary.

IirModuleInfoProvider

Implements the interfaces to query properties of the processor like name, id, version and supported GPU platforms. Also provides the engines with the names of the processor device functions.

IirModuleLibrary

Defines the module export functions to create and destroy the IirModule, IirDeviceCodeProvider and IirModuleInfoProvider.

IirInputPort

Implements the input to the processor. Provides functionality to connect, disconnect or update inputs tot the processor.

IirProcessor

This is the host-side of the processor and implements the processor interface. Configures the execution of the processor and provides parameters for the GPU tasks.

Device Code Components

Properties

Defines the names for device function substitution to avoid name conflicts between processors. Also contains user-defined parameter structs, which are passed to the processor functions during processing.

IirProcessor.cuh

The device side implementation of the processor. Defines the GPU processor and its tasks, i.e., the processing functions.

IirProcessor.cu

Declares the GPU tasks and the GPU processor using pre-defined macros.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published