Hi Julius and Dario, Thank you for your suggestions, took me a little to test because in online faust ide things sound differently for some reason. At first I was thinking about sorting algorithms but didn't know they were just implemented, until Dario's example. Do I get it right that we can not have a variable window length with them?
On Sun, Jan 9, 2022 at 1:12 PM Julius Smith <julius.sm...@gmail.com> wrote: > You should be able to subtract median3 from medianFilter(3) in Faust and > get 0 as the optimized output - Julius > > On Sun, Jan 9, 2022 at 1:49 AM Dario Sanfilippo < > sanfilippo.da...@gmail.com> wrote: > >> Hello, Julius and Alik. >> >> I'm new to median filters but we should be able to use the recently added >> sorting algorithm for arbitrary window lenghts; does the following look >> correct to you? >> >> import("stdfaust.lib"); >> windowLen = 11; // it should be odd for symmetry >> medianFilter(L, x) = (x <: par(i, L, @(i))) : ro.bubbleSort(L) : >> ba.selectn(L, int(L / 2)); >> process = no.noise <: _ , medianFilter(windowLen); >> >> Ciao, >> Dr Dario Sanfilippo >> http://dariosanfilippo.com >> >> >> On Sun, 9 Jan 2022 at 10:28, Julius Smith <julius.sm...@gmail.com> wrote: >> >>> Hi Alik, >>> >>> This came up for me at some point: >>> >>> // Test order 3 median smoother: >>> >>> median3(a,b,c) = select3(s,b,a,c) >>> with { >>> cf(a,b) = 2*(a<b)-1; >>> s=abs(cf(a,b)+2*cf(b,c)+3*cf(c,a))/2; >>> }; >>> >>> process = median3(1,2,3), median3(1,3,2), median3(2,1,3), >>> median3(2,3,1), median3(3,1,2), median3(3,2,1); // 2 >>> >>> Cheers, >>> Julius >>> >>> On Sun, Jan 9, 2022 at 12:51 AM Alik Rustamoff <alikthen...@gmail.com> >>> wrote: >>> >>>> What is the way to make a median filter in faust? >>>> >>>> _______________________________________________ >>>> Faudiostream-users mailing list >>>> Faudiostream-users@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users >>>> >>> >>> >>> -- >>> "Anybody who knows all about nothing knows everything" -- Leonard >>> Susskind >>> _______________________________________________ >>> Faudiostream-users mailing list >>> Faudiostream-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users >>> >> > > -- > "Anybody who knows all about nothing knows everything" -- Leonard Susskind >
_______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users