直交射影

2013 Sep 3
Masahiro Mizutani

3 角関数基底での直交射影

base[t,n_]:=Flatten[{1/Sqrt[2Pi],Table[{Cos[k t]/Sqrt[Pi],Sin[k t]/Sqrt[Pi]},{k,1,n}]}]

f[t]=t;

ip[p1_,p2_]:=Integrate[p1 p2,{t,-Pi,Pi}]

base[t,1]

pf1[t_]=Sum[Projection[f[t],base[t,1][[i]],ip],{i,1,Length[base[t,1]]}]

Plot[pf1[t],{t,-Pi,Pi}]

pf2[t_]=Sum[Projection[f[t],base[t,2][[i]],ip],{i,1,Length[base[t,2]]}]

Plot[pf2[t],{t,-Pi,Pi}]

pf3[t_]=Sum[Projection[f[t],base[t,3][[i]],ip],{i,1,Length[base[t,3]]}]

Plot[pf3[t],{t,-Pi,Pi}]

f2[t]=t^2;

pf23[t_]=Sum[Projection[f2[t],base[t,3][[i]],ip],{i,1,Length[base[t,3]]}]

Plot[pf23[t],{t,-Pi,Pi}]

Haar基底での直交射影

haarScaling[t_]:=If[t<0 || 1 <=t, 0,1]

haarWavelet[t_]:=Piecewise[{{1,0≤t && t<1/2},{-1,1/2≤t && t<1}},0]

Plot[haarScaling[t],{t,-0.5,1.5}]

Plot[haarWavelet[t],{t,-0.5,1.5}]

iph[p1_,p2_]:=Integrate[p1 p2,{t,0,1}]

hbasis[t]={haarScaling[t],haarWavelet[t],haarWavelet[2t],haarWavelet[2t-1]};

Integrate[haarWavelet[t]^2,{t,0,1}]

f[t]=t;

hpf[t_]=Sum[Projection[f[t],hbasis[t][[i]],iph],{i,1,4}]

Plot[hpf[t],{t,0,1}]