Azure / Azure/Accord-NET

Low pass filter not working

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
26
Forks
24
PR merge metrics
No merged PRs in 30d

Description

- [x] question
- [x] bug report

I am trying to Use low pass filter but the output is same as the original signal, only difference is the volume/gain or amplitude is less when I play the output wav file.

I have generated a sin wave 4KHz .wav file using NAudio library now I am trying to pass it through a Low Pass Filter using Accord.Audio.Filters LPF implementation.

I am getting the resulting wav file but still the sin wave signal is present after passing through LPF only difference is the volume/gain or amplitude is less when I play the output wav file.

Below is my implementation

is there anything wrong in the code?

```
var inSignal = Signal.FromFile("filteroutput.wav");
LowPassFilter accordFilter = new LowPassFilter(1, inSignal.SampleRate);
var outSignal = accordFilter.Apply(inSignal);

MemoryStream destinationStream = new MemoryStream();
//var fileStream = new FileStream("filteroutput1.wav", FileMode.CreateNew, FileAccess.ReadWrite);

// Create a encoder for the destination stream
WaveEncoder encoder = new WaveEncoder("filteroutput1.wav");

// Encode the signal to the destination stream
encoder.Encode(outSignal);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.