(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 10.4' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 25265, 700] NotebookOptionsPosition[ 23371, 640] NotebookOutlinePosition[ 23708, 655] CellTagsIndexPosition[ 23665, 652] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{ RowBox[{"linalg", "=", RowBox[{"<<", "linalg-wav.m"}]}], ";"}]], "Input", CellChangeTimes->{{3.675777042782992*^9, 3.675777050802915*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"linalg", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.675763087731227*^9, 3.675763094439691*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Re", "[", RowBox[{"Fourier", "[", "linalg", "]"}], "]"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.675763098060884*^9, 3.675763121055097*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{"linalg", ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.6756827057147818`*^9, 3.675682721876379*^9}, { 3.6756827730515347`*^9, 3.675682775865152*^9}}], Cell[CellGroupData[{ Cell["Entrauschen", "Section", CellChangeTimes->{{3.675777723522546*^9, 3.675777725338674*^9}, { 3.6757777707067537`*^9, 3.675777772234611*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"linalgnoise", "=", RowBox[{"linalg", "+", RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", ".05"}], "]"}], ",", RowBox[{"{", RowBox[{"Length", "[", "linalg", "]"}], "}"}]}], "]"}]}]}], ";"}]], "Input", CellChangeTimes->{{3.6757632025319357`*^9, 3.6757632138073397`*^9}, { 3.675769862220626*^9, 3.6757698685086946`*^9}, {3.6757705221262627`*^9, 3.6757705338613586`*^9}, {3.675770583158244*^9, 3.6757705833176117`*^9}, { 3.6757706993269663`*^9, 3.6757707238225203`*^9}, {3.6757711635097923`*^9, 3.6757711793660927`*^9}, {3.6757715925694437`*^9, 3.675771592781867*^9}, { 3.675772734186928*^9, 3.6757727607990913`*^9}, {3.675772949146021*^9, 3.675772987131961*^9}, {3.675773101219405*^9, 3.675773101369727*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"linalgnoise", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.675769787835951*^9, 3.675769792148196*^9}, { 3.675777327104334*^9, 3.6757773320791283`*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Re", "[", RowBox[{"Fourier", "[", "linalgnoise", "]"}], "]"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.675769803384861*^9, 3.675769815036187*^9}, { 3.6757773512451143`*^9, 3.6757773590594053`*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{"linalgnoise", ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.6757632156421843`*^9, 3.675763223022252*^9}}], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{"denoise", " ", "1", "st", " ", RowBox[{"attempt", ":", " ", RowBox[{ "cut", " ", "off", " ", "high", " ", "frequencies", " ", "from", " ", "whole", " ", RowBox[{"signal", ".", " ", "doesnt"}], " ", "work", " ", "so", " ", "well"}]}]}], " ", "*)"}]], "Input", CellChangeTimes->{{3.675683160205413*^9, 3.675683169287239*^9}, { 3.675683492850101*^9, 3.675683506410289*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"denoise1", "[", "signal_", "]"}], " ", ":=", " ", RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{ RowBox[{"Fourier", "[", "signal", "]"}], "*", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"i", "\[LessEqual]", RowBox[{".06", RowBox[{"Length", "[", "signal", "]"}]}]}], ",", "1", ",", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "signal", "]"}]}], "}"}]}], "]"}]}], "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.675771994842498*^9, 3.6757720275273952`*^9}, { 3.675772065159219*^9, 3.675772087664137*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"denoise1", "[", "linalgnoise", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675679504994425*^9, 3.675679508452373*^9}, { 3.675679557533296*^9, 3.675679724158224*^9}, {3.675679843596336*^9, 3.6756798649112473`*^9}, {3.675681307682001*^9, 3.675681360155397*^9}, { 3.675681470071308*^9, 3.67568151468515*^9}, {3.675681559629752*^9, 3.675681568850935*^9}, {3.675681600686392*^9, 3.675681620776326*^9}, { 3.675681655805552*^9, 3.675681679943042*^9}, {3.675682861831131*^9, 3.67568296028063*^9}, {3.675683022306862*^9, 3.675683059372778*^9}, { 3.6757632309750967`*^9, 3.67576323175272*^9}, {3.675763264845686*^9, 3.675763288327276*^9}, {3.675769765381761*^9, 3.675769777493335*^9}, { 3.675769892453369*^9, 3.6757699016055117`*^9}, {3.6757706780382557`*^9, 3.675770683703673*^9}, {3.675770748934271*^9, 3.675770765750351*^9}, { 3.675772041056522*^9, 3.675772052191927*^9}}], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ RowBox[{"denoise", " ", "2", "nd", " ", RowBox[{"attempt", ":", " ", "same"}]}], ",", " ", RowBox[{ "but", " ", "with", " ", "smaller", " ", "junks", " ", "of", " ", "the", " ", "signal"}]}], " ", "*)"}]], "Input", CellChangeTimes->{{3.675683479255535*^9, 3.675683518364966*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"denoise2", "[", "signal_", "]"}], ":=", RowBox[{"Flatten", "[", RowBox[{"denoise1", "/@", RowBox[{"Partition", "[", RowBox[{"signal", ",", "200"}], "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.675772109988883*^9, 3.6757721342303343`*^9}, { 3.675772199738337*^9, 3.675772200310586*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"denoise2", "[", "linalgnoise", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675680283169887*^9, 3.675680452058304*^9}, { 3.6756805120357113`*^9, 3.6756805665233173`*^9}, {3.675680860878049*^9, 3.6756808771168222`*^9}, {3.675680959543579*^9, 3.6756810276716833`*^9}, { 3.675681075881242*^9, 3.6756811106233473`*^9}, {3.675681153835642*^9, 3.675681284952194*^9}, {3.675683092674436*^9, 3.675683455923606*^9}, { 3.6756835250771627`*^9, 3.67568358651929*^9}, {3.6757632427580547`*^9, 3.675763249869681*^9}, {3.675770567743165*^9, 3.6757705682302427`*^9}, { 3.6757712192873793`*^9, 3.6757713500710087`*^9}, {3.675771435572649*^9, 3.675771553712666*^9}, 3.675772103783718*^9, {3.675772141088565*^9, 3.675772153975637*^9}, {3.6757774533746433`*^9, 3.6757774565080347`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{"denoise", " ", "3", "rd", " ", RowBox[{"attempt", ":", " ", RowBox[{ "convolution", " ", "with", " ", "a", " ", "bell", " ", "shape"}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"bell", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "/", "25"}], RowBox[{ RowBox[{"(", RowBox[{"x", "-", "25"}], ")"}], "^", "2"}]}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "50"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"denoise3", "[", "signal_", "]"}], ":=", RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{ RowBox[{"Fourier", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"0", "*", "bell"}], ",", "signal"}], "]"}], "]"}], "*", RowBox[{"Fourier", "[", RowBox[{"Join", "[", RowBox[{"bell", ",", RowBox[{"0", "*", "signal"}]}], "]"}], "]"}]}], "]"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.675683604701393*^9, 3.675683828993287*^9}, { 3.675683909970192*^9, 3.675683917432357*^9}, {3.6756840261396637`*^9, 3.675684311096116*^9}, {3.675684346744732*^9, 3.675684347633902*^9}, { 3.675684427859674*^9, 3.675684460936406*^9}, {3.675684584167089*^9, 3.675684721496389*^9}, {3.675684766766411*^9, 3.675684784650276*^9}, { 3.67576335271168*^9, 3.67576335329537*^9}, {3.675764950239019*^9, 3.675765020766787*^9}, {3.6757650845481052`*^9, 3.675765092865428*^9}, { 3.675766025307869*^9, 3.675766090557599*^9}, {3.6757682932360277`*^9, 3.675768338469942*^9}, {3.6757683846444883`*^9, 3.675768458756399*^9}, { 3.675772233351293*^9, 3.675772349874296*^9}, {3.675772429807646*^9, 3.675772431012064*^9}, {3.675773061559081*^9, 3.6757730735576477`*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"denoise3", "[", "linalgnoise", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.6757684804697027`*^9, 3.675768625074519*^9}, 3.6757699376754723`*^9, {3.675769982758045*^9, 3.67577003209389*^9}, { 3.6757701061634827`*^9, 3.675770135893643*^9}, {3.675770172871937*^9, 3.67577017308576*^9}, {3.6757702122388897`*^9, 3.6757702506235867`*^9}, { 3.675770280738446*^9, 3.67577038293565*^9}, {3.675770464366272*^9, 3.675770496078032*^9}, {3.675771713187196*^9, 3.67577173394413*^9}, { 3.6757718677036457`*^9, 3.675771884367333*^9}, {3.675771939383675*^9, 3.675771945287758*^9}, {3.675772356920866*^9, 3.675772364639331*^9}, { 3.675777475232402*^9, 3.675777476764*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{"denoise", " ", "4", "th", " ", RowBox[{"attempt", ":", " ", RowBox[{ "round", " ", "small", " ", "amplitudes", " ", "to", " ", "zero"}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"denoise4", "[", "signal_", "]"}], ":=", RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Abs", "[", "#", "]"}], "<", ".1"}], ",", "0", ",", "#"}], "]"}], "&"}], "/@", RowBox[{"Fourier", "[", "signal", "]"}]}], "]"}], "]"}]}]}]], "Input", CellChangeTimes->{{3.6760241457468557`*^9, 3.676024210506524*^9}, { 3.6760242407412148`*^9, 3.676024261651477*^9}, {3.676043611105505*^9, 3.676043630253325*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"denoise4", "[", "linalgnoise", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{3.676024231330387*^9}] }, Open ]], Cell[CellGroupData[{ Cell["Langsamer und schneller", "Section", CellChangeTimes->{{3.675777745770602*^9, 3.6757777639865847`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"stretch", "[", "list_", "]"}], " ", ":=", " ", RowBox[{ RowBox[{ RowBox[{"Riffle", "[", RowBox[{"#", ",", RowBox[{"Most", "[", " ", RowBox[{ RowBox[{"(", RowBox[{"#", " ", "+", " ", RowBox[{"RotateLeft", "[", RowBox[{"#", ",", "1"}], "]"}]}], ")"}], "/", "2"}], "]"}]}], "]"}], "&"}], "[", "list", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"shrink", "[", "list_", "]"}], ":=", RowBox[{"Table", "[", RowBox[{ RowBox[{"list", "[", RowBox[{"[", RowBox[{ RowBox[{"2", "i"}], "-", "1"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Length", "[", "list", "]"}], "/", "2"}]}], "}"}]}], "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.675703633542018*^9, 3.6757036564727497`*^9}, { 3.6757036874108133`*^9, 3.675703687715271*^9}, {3.675703753440319*^9, 3.675703781027021*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"stretch", "[", "linalg", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}], " "}]], "Input", CellChangeTimes->{{3.675763629432146*^9, 3.67576364110528*^9}, { 3.675763730735242*^9, 3.675763733943131*^9}, 3.675764897553582*^9}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"Join", "@@", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{"Take", "[", RowBox[{ RowBox[{"stretch", "[", RowBox[{"Fourier", "[", "#", "]"}], "]"}], ",", "200"}], "]"}], "]"}], "]"}], "&"}], " ", "/@", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"stretch", "[", "linalg", "]"}], ",", "200"}], "]"}]}], ")"}]}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675764337939097*^9, 3.675764374346519*^9}, { 3.675764473424345*^9, 3.675764511091023*^9}, {3.6757645579957314`*^9, 3.6757646474718657`*^9}, {3.675773380580818*^9, 3.675773383040114*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"denoise3", "[", RowBox[{"Join", "@@", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{"Take", "[", RowBox[{ RowBox[{"stretch", "[", RowBox[{"Fourier", "[", "#", "]"}], "]"}], ",", "200"}], "]"}], "]"}], "]"}], "&"}], " ", "/@", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"stretch", "[", "linalg", "]"}], ",", "200"}], "]"}]}], ")"}]}], "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675765055852182*^9, 3.675765060440805*^9}, { 3.6757651286050034`*^9, 3.675765157457714*^9}, 3.675773199748868*^9, { 3.6757733903779373`*^9, 3.67577339279723*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"shrink", "[", "linalg", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675764697514389*^9, 3.6757647090581512`*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"Join", "@@", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{"PadRight", "[", RowBox[{ RowBox[{"shrink", "[", RowBox[{"Fourier", "[", "#", "]"}], "]"}], ",", "500"}], "]"}], "]"}], "]"}], "&"}], " ", "/@", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"shrink", "[", "linalg", "]"}], ",", "500"}], "]"}]}], ")"}]}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.6757647231309137`*^9, 3.675764749544392*^9}, { 3.675764788107943*^9, 3.675764811732732*^9}, {3.675773445632051*^9, 3.675773466400823*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"denoise3", "[", RowBox[{"Join", "@@", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{"PadRight", "[", RowBox[{ RowBox[{"shrink", "[", RowBox[{"Fourier", "[", "#", "]"}], "]"}], ",", "500"}], "]"}], "]"}], "]"}], "&"}], " ", "/@", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"shrink", "[", "linalg", "]"}], ",", "500"}], "]"}]}], ")"}]}], "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675773494640771*^9, 3.675773500875461*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Echo/Hall", "Section", CellChangeTimes->{{3.675777796090577*^9, 3.675777796442627*^9}, { 3.6757780431070433`*^9, 3.675778046723214*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"pattern", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", "20000", "}"}]}], "]"}]}], ";", RowBox[{ RowBox[{"pattern", "[", RowBox[{"[", "1", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"pattern", "[", RowBox[{"[", "10000", "]"}], "]"}], "=", ".333"}], ";", RowBox[{ RowBox[{"pattern", "[", RowBox[{"[", "20000", "]"}], "]"}], "=", ".25"}], ";"}]], "Input", CellChangeTimes->{{3.6757777999888067`*^9, 3.675777863963584*^9}, { 3.675777946823784*^9, 3.6757779575247097`*^9}, 3.675777994005096*^9, { 3.6757780287515574`*^9, 3.675778050174767*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{"Re", "[", RowBox[{"InverseFourier", "[", RowBox[{ RowBox[{"Fourier", "[", RowBox[{"Join", "[", RowBox[{"linalg", ",", RowBox[{"0", "*", "pattern"}]}], "]"}], "]"}], "*", RowBox[{"Fourier", "[", RowBox[{"Join", "[", RowBox[{"pattern", ",", RowBox[{"0", "*", "linalg"}]}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.6757778696622868`*^9, 3.6757779355402613`*^9}, { 3.675777982397513*^9, 3.67577798744103*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Spracherkennung", "Section", CellChangeTimes->{{3.6757777857225933`*^9, 3.6757777878907757`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"a", "=", RowBox[{"<<", "a-wav.m"}]}], ";"}]], "Input", CellChangeTimes->{{3.675777579092108*^9, 3.6757775837333527`*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{"a", ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675765332323593*^9, 3.675765392480835*^9}, { 3.675765441289023*^9, 3.675765476817771*^9}, {3.6757655968973713`*^9, 3.6757657290094337`*^9}, 3.675765819914336*^9, {3.675766653173575*^9, 3.67576667108591*^9}, {3.6757673460031013`*^9, 3.675767360314476*^9}, 3.675767400788047*^9, {3.675773808913343*^9, 3.675773833064581*^9}, 3.675777593436574*^9}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"linalg", "/", RowBox[{"Min", "[", RowBox[{"Sum", "[", RowBox[{ RowBox[{"RotateRight", "[", RowBox[{ RowBox[{"Abs", "[", "linalg", "]"}], ",", "k"}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "0", ",", "40"}], "}"}]}], "]"}], "]"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "1"}]}], "]"}]], "Input", CellChangeTimes->{{3.6757663839037848`*^9, 3.675766428649972*^9}, { 3.675767083119451*^9, 3.675767097365303*^9}, {3.67577386691331*^9, 3.675773969184702*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"data", "=", RowBox[{ RowBox[{ RowBox[{"Drop", "[", RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{"InverseFourier", "[", RowBox[{ RowBox[{"Fourier", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"0", "*", "#"}], ",", RowBox[{"denoise1", "[", "linalg", "]"}]}], "]"}], "]"}], "*", RowBox[{"Fourier", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Reverse", "[", RowBox[{"denoise1", "[", "#", "]"}], "]"}], ",", RowBox[{"0", "*", "linalg"}]}], "]"}], "]"}]}], "]"}], "]"}], "/", RowBox[{"Min", "[", RowBox[{"Sum", "[", RowBox[{ RowBox[{"RotateRight", "[", RowBox[{ RowBox[{"Abs", "[", RowBox[{"Join", "[", RowBox[{"#", ",", "linalg"}], "]"}], "]"}], ",", "k"}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "0", ",", "40"}], "}"}]}], "]"}], "]"}]}], ",", RowBox[{"Length", "[", "#", "]"}]}], "]"}], "&"}], "[", "a", "]"}]}], "]"}]], "Input", CellChangeTimes->{{3.675765832458004*^9, 3.675766003970944*^9}, 3.675766362810359*^9, {3.675766904635371*^9, 3.675766953866949*^9}, { 3.675767489069818*^9, 3.6757675175478983`*^9}, {3.675767561397416*^9, 3.675767609556053*^9}, {3.6757677019281387`*^9, 3.675767781139851*^9}, { 3.6757739568853817`*^9, 3.675773957009701*^9}, {3.675774022483121*^9, 3.675774043130196*^9}, {3.67577407594671*^9, 3.675774109867216*^9}, { 3.675774168057724*^9, 3.675774171817403*^9}, {3.675774326238937*^9, 3.6757744647502117`*^9}, {3.675774571087907*^9, 3.675774571409711*^9}, { 3.675774890651219*^9, 3.6757748915301237`*^9}, {3.6757750520105886`*^9, 3.6757750593232727`*^9}, {3.675775856411187*^9, 3.6757758802754498`*^9}, 3.6757760844275227`*^9, {3.67577630689712*^9, 3.6757764106771383`*^9}, { 3.675776493916397*^9, 3.675776532283901*^9}}], Cell[BoxData[ RowBox[{"Flatten", "[", RowBox[{ RowBox[{ RowBox[{"Position", "[", RowBox[{"data", ",", "#"}], "]"}], "&"}], "/@", RowBox[{"Take", "[", RowBox[{ RowBox[{"Reverse", "[", RowBox[{"Sort", "[", "data", "]"}], "]"}], ",", "20"}], "]"}]}], "]"}]], "Input", CellChangeTimes->{{3.6757750124187317`*^9, 3.675775014920689*^9}, { 3.675776350898971*^9, 3.675776357787541*^9}, 3.675776420307922*^9, { 3.675776546837985*^9, 3.675776614077619*^9}, {3.675776657475514*^9, 3.6757766592749243`*^9}}], Cell[BoxData[ RowBox[{"Union", "[", RowBox[{ RowBox[{"Floor", "[", RowBox[{"%", "/", "1000"}], "]"}], "1000"}], "]"}]], "Input", CellChangeTimes->{{3.6757768458630877`*^9, 3.67577685110719*^9}, { 3.67577761970327*^9, 3.675777622063483*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"linalg", "[", RowBox[{"[", RowBox[{ RowBox[{"#", "-", "2500"}], ";;", RowBox[{"#", "+", "2500"}]}], "]"}], "]"}], "&"}], "[", "17000", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675775023441258*^9, 3.675775026665063*^9}, { 3.675775899482263*^9, 3.675775947482123*^9}, {3.6757760968353443`*^9, 3.6757761806032667`*^9}, {3.6757764327318573`*^9, 3.675776475578868*^9}, { 3.675776868267445*^9, 3.675776943507555*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"linalg", "[", RowBox[{"[", RowBox[{ RowBox[{"#", "-", "2500"}], ";;", RowBox[{"#", "+", "2500"}]}], "]"}], "]"}], "&"}], "[", "26000", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675776952782535*^9, 3.675776953694189*^9}}], Cell[BoxData[ RowBox[{"ListPlay", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"linalg", "[", RowBox[{"[", RowBox[{ RowBox[{"#", "-", "2500"}], ";;", RowBox[{"#", "+", "2500"}]}], "]"}], "]"}], "&"}], "[", "47000", "]"}], ",", RowBox[{"SampleRate", "\[Rule]", "45000"}]}], "]"}]], "Input", CellChangeTimes->{{3.675776974150638*^9, 3.675776974291711*^9}}] }, Open ]] }, WindowSize->{1024, 744}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"10.4 for Linux x86 (64-bit) (February 25, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 169, 4, 32, "Input"], Cell[730, 26, 266, 7, 32, "Input"], Cell[999, 35, 332, 9, 32, "Input"], Cell[1334, 46, 251, 5, 32, "Input"], Cell[CellGroupData[{ Cell[1610, 55, 147, 2, 65, "Section"], Cell[1760, 59, 848, 17, 32, "Input"], Cell[2611, 78, 322, 8, 32, "Input"], Cell[2936, 88, 390, 10, 32, "Input"], Cell[3329, 100, 205, 4, 32, "Input"], Cell[3537, 106, 450, 10, 32, "Input"], Cell[3990, 118, 732, 20, 55, "Input"], Cell[4725, 140, 1013, 16, 32, "Input"], Cell[5741, 158, 346, 8, 32, "Input"], Cell[6090, 168, 345, 8, 32, "Input"], Cell[6438, 178, 918, 14, 32, "Input"], Cell[7359, 194, 1962, 47, 99, "Input"], Cell[9324, 243, 804, 13, 32, "Input"], Cell[10131, 258, 821, 22, 55, "Input"], Cell[10955, 282, 215, 5, 32, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[11207, 292, 110, 1, 65, "Section"], Cell[11320, 295, 1043, 31, 55, "Input"], Cell[12366, 328, 325, 7, 32, "Input"], Cell[12694, 337, 823, 21, 32, "Input"], Cell[13520, 360, 851, 22, 55, "Input"], Cell[14374, 384, 234, 5, 32, "Input"], Cell[14611, 391, 777, 21, 32, "Input"], Cell[15391, 414, 728, 20, 55, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[16156, 439, 145, 2, 65, "Section"], Cell[16304, 443, 647, 17, 32, "Input"], Cell[16954, 462, 632, 16, 32, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[17623, 483, 104, 1, 65, "Section"], Cell[17730, 486, 161, 4, 32, "Input"], Cell[17894, 492, 514, 9, 32, "Input"], Cell[18411, 503, 590, 15, 32, "Input"], Cell[19004, 520, 2114, 48, 99, "Input"], Cell[21121, 570, 547, 14, 32, "Input"], Cell[21671, 586, 255, 6, 32, "Input"], Cell[21929, 594, 606, 15, 32, "Input"], Cell[22538, 611, 407, 12, 32, "Input"], Cell[22948, 625, 407, 12, 32, "Input"] }, Open ]] } ] *)