Filtriranje diskretnih signalov

Konstrukcija nizkopasovnega filtra, ki propušča prvih pet frekvenc.

delta[k_,N_]=Table[DiscreteDelta[n-k],{n,1,N}];

For[{k=1,filter=delta[1,100]},k<6,k++,filter=filter+delta[k+1,100]+delta[101-k,100]];

ListPlot[filter,PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}],PlotRange->{-0.1,1.2}]

Filtriranje sinusnega signala f[k] = sin(2πk/100), ki mu je dodan naključen šum.

graf=Table[Sin[2Pi*k/100],{k,1,100}];

napaka=RandomReal[{-0.15,0.15},100];

signal=graf+napaka;

ListPlot[signal,PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}],PlotRange->{-1.2,1.2}]

spekter=Fourier[signal];

ListPlot[Abs[spekter]^2,PlotRange->{0,30},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]]

filspekter=spekter*filter;

filsignal=InverseFourier[filspekter];

ListPlot[{signal,filsignal},PlotStyle->{Blue,Black},AxesStyle->Arrowheads[{0.04}],PlotRange->{-1.2,1.2}]

Filtriranje periodičnega signala f[k] = sin(2πk/100)+sin(6πk/100), ki ima pasovno širino znotraj območja filtra.

signal1=Table[Sin[2Pi*k/100],{k,1,100}];

signal2=Table[Sin[2Pi*k*3/100],{k,1,100}];

signal=signal1+signal2;

ListPlot[{signal1,signal2,signal},PlotStyle->{Green,Green,Blue},AxesStyle->Arrowheads[{0.04}]]

spekter=Fourier[signal];

ListPlot[Abs[spekter]^2,PlotRange->{0,30},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]]

filspekter=spekter*filter;

filsignal=InverseFourier[filspekter];

ListPlot[{signal,filsignal},PlotStyle->{Black,Blue},AxesStyle->Arrowheads[{0.04}]]

Filtriranje periodičnega signala f[k] = sin(2πk/100)+sin(12πk/100), ki ima eno izmed frekvenc izven območja filtra.

signal1=Table[Sin[2Pi*k/100],{k,1,100}];

signal2=Table[Sin[2Pi*k*6/100],{k,1,100}];

signal=signal1+signal2;

ListPlot[{signal1,signal2,signal},PlotStyle->{Green,Green,Blue},AxesStyle->Arrowheads[{0.04}]]

spekter=Fourier[signal];

ListPlot[Abs[spekter]^2,PlotRange->{0,30},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]]

filspekter=spekter*filter;

filsignal=InverseFourier[filspekter];

ListPlot[{signal,filsignal},PlotStyle->{Blue,Black},AxesStyle->Arrowheads[{0.04}]]