Author Topic: Input for a filter  (Read 411 times)

0 Members and 1 Guest are viewing this topic.

Offline prophossTopic starter

  • Contributor
  • Posts: 46
  • Country: us
Input for a filter
« on: April 24, 2022, 09:41:31 pm »
I have been wanting to create an FIR filter using some code like C or python. I have found plenty of code but have been wondering where or how can you get the input for the filter? What would be the simplest way to get some input data to apply that FIR filter to? If this doesn't make sense let me know and I can try and explain again.
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1158
  • Country: lt
Re: Input for a filter
« Reply #1 on: April 24, 2022, 10:40:42 pm »
1. Reading samples from wave (uncompressed) audio files.
2. Writing a function to generate array of samples of various waves. Sine wave can be made with, you guessed it, sin(x) function. You can add in harmonics if you want. You can also produce square wave, triangle. Store the samples in an array and feed your filter.
 

Offline prophossTopic starter

  • Contributor
  • Posts: 46
  • Country: us
Re: Input for a filter
« Reply #2 on: April 24, 2022, 11:02:25 pm »
That may well fit the bill. I did not know about python's sin(x). Thank you for that.

edit:
Was able to create a file with the sine wave using for loop from 0 through 25. That can be adjusted to any amount really. Now I will have something to play with. Now I need tp look into adding the harmonics.;D
Thanks, Manul
« Last Edit: April 24, 2022, 11:28:06 pm by prophoss »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf