This example shows how to filter signal by using "Remez exchange algorithm" filtering method from the Julia DSP package. DSP package includes many other filter types and methods.  


You will have to install DSP package before using this example.


using DSP


function process( input_windows::Array{SigviewWindow}, output_signal::SigviewSignalWindow )

  #create passband filter 1100-1900Hz

  remez_filter = remez(35, [(0, 1000)=>0, (1100, 1900)=>1, (2000, input_windows[1].samplingRate/2)=>0]; Hz = input_windows[1].samplingRate )

  #apply filter to the samples of the first input signal

  output_signal.samples = filt(remez_filter, input_windows[1].samples )

  #take all other signal properties from the input signal

  output_signal.samplingRate = input_windows[1].samplingRate

  output_signal.xAxisBegin = input_windows[1].xAxisBegin

  output_signal.xAxisUnit = input_windows[1].xAxisUnit

  output_signal.yAxisUnit = input_windows[1].yAxisUnit

  return true

end