Simple multichannel filter
In this example we will study the possibilities of frame filtering in multichannel mode on the example of a simple FIR filter.
The figure below shows the model we are studying
in this demonstration.

In this model, three different types of signals are input, and then each of them is passed through a filter. At the output we can analyse all signals together or each signal separately.
Before we start analysing the model, we set two auxiliary functions - the model run function and the audio player function.
Pkg.add(["WAV"])
# Подключение вспомогательной функции запуска модели.
function run_model( name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
model = engee.open( name_model ) # Открыть модель
model_output = engee.run( model, verbose=true ); # Запустить модель
else
model = engee.load( Path, force=true ) # Загрузить модель
model_output = engee.run( model, verbose=true ); # Запустить модель
engee.close( name_model, force=true ); # Закрыть модель
end
sleep(5)
return model_output
end
using WAV;
using .EngeeDSP;
function audioplayer(patch, fs, Samples_per_audio_channel);
s = vcat((EngeeDSP.step(load_audio(), patch, Samples_per_audio_channel))...);
buf = IOBuffer();
wavwrite(s, buf; Fs=fs);
data = base64encode(unsafe_string(pointer(buf.data), buf.size));
display("text/html", """<audio controls="controls" {autoplay}>
<source src="data:audio/wav;base64,$data" type="audio/wav" />
Your browser does not support the audio element.
</audio>""");
return s
end
Now let's run the model and analyse the obtained results.
run_model("simple_filt_multichannel") # Запуск модели.
out = collect(out);
out = out.value;
Let's plot the display of all three channels of the system output.
n = 50;
Chirp = zeros(n,1);
Sine = zeros(n,1);
Signal = zeros(n,1);
for i in 1:n
a = out[i]
Chirp[i] = a[1]
Sine[i] = a[2]
Signal[i] = a[3]
end
plot(Chirp, label="Chirp")
plot!(Sine, label="Sine")
plot!(Signal, label="Signal")
In the graph, the three signals have completely different character and we can easily distinguish them from each other.
Now let's analyse two audio tracks - the original one and the one recorded from the model.
audioplayer("$(@__DIR__)/OSR_us_000_0030_8k.wav", 8000, 256);
audioplayer("$(@__DIR__)/output.wav", 8000, 256);
On the recording you can hear that after filtering the audio track does contain less extraneous noise.
Conclusion
We have explored the possibilities of multichannel data processing. This approach is often found in communication systems and is very much in demand by developers.