|
|
Python |
Matlab/Octave |
Vorbereitung (Laden von Modulen/Paketen) |
|
from numpy import *
|
|
Dirichlet-Fenster (Rechteckfenster) |
|
M=100
w=ones(M)
|
M=100;
w=ones(1,M);
|
Bartlett-Fenster (Fejer- Fenster, Dreieckfenster) |
|
M=100
w=1-abs((2*arange(0,M)+1)/float(M)-1)
oder
M=100
wo=bartlett(2*M+1)
w=zeros(M)
for i in range(0,M):
w[i]=wo[2*i+1]
|
M=100;
w=1-abs((2*(0:M-1)+1)/M-1);
oder
M=100;
wo=bartlett(2*M+1);
w=zeros(1,M);
for i=1:M
w(i)=wo(2*i);
end
|
Kosinusfenster |
|
M=100
w=sin(pi*(arange(0,M)+0.5)/M)
|
M=100;
w=sin(pi*((0:M-1)+0.5)/M);
|
Welch-Fenster |
|
M=100
w=1-((2*arange(0,M)+1)/float(M)-1)**2
|
M=100;
w=1-((2*(0:M-1)+1)/M-1).^2;
|
Connes-Fenster |
|
M=100
w=(1-((2*arange(0,M)+1)/float(M)-1)**2)**2
|
M=100;
w=(1-((2*(0:M-1)+1)/M-1).^2).^2;
|
von-Hann-Fenster (Hanning-Fenster) |
|
M=100
w=0.5-0.5*cos(pi*(2*arange(0,M)+1)/float(M))
oder
M=100
wo=hanning(2*M+1)
w=zeros(M)
for i in range(0,M):
w[i]=wo[2*i+1]
| M=100;
w=0.5-0.5*cos(pi*(2*(0:M-1)+1)/M);
oder
M=100;
wo=hann(2*M+1);
w=zeros(1,M);
for i=1:M
w(i)=wo(2*i);
end
|
Hamming-Fenster |
|
M=100
w=0.54-0.46*cos(pi*(2*arange(0,M)+1)/float(M))
oder
M=100
wo=hamming(2*M+1)
w=zeros(M)
for i in range(0,M):
w[i]=wo[2*i+1]
| M=100;
w=0.54-0.46*cos(pi*(2*(0:M-1)+1)/M);
oder
M=100;
wo=hamming(2*M+1);
w=zeros(1,M);
for i=1:M
w(i)=wo(2*i);
end
|
Blackman-Fenster |
|
M=100
w=0.42-0.5*cos(pi*(2*arange(0,M)+1)/float(M))+0.08*cos(2*pi*(2*arange(0,M)+1)/float(M))
oder
M=100
wo=blackman(2*M+1)
w=zeros(M)
for i in range(0,M):
w[i]=wo[2*i+1]
|
M=100;
w=0.42-0.5*cos(pi*(2*(0:M-1)+1)/M)+0.08*cos(2*pi*(2*(0:M-1)+1)/M);
oder
M=100;
wo=blackman(2*M+1);
w=zeros(1,M);
for i=1:M
w(i)=wo(2*i);
end
|
Flattop-Fenster |
|
M=100
w=0.21557895-0.41663158*cos(pi*(2*arange(0,M)+1)/float(M))+0.277263158*cos(2*pi*(2*arange(0,M)+1)/float(M))-0.083578947*cos(3*pi*(2*arange(0,M)+1)/float(M))+0.006947368*cos(4*pi*(2*arange(0,M)+1)/float(M))
oder
from scipy.signal import *
M=100
wo=flattop(2*M+1)
w=zeros(M)
for i in range(0,M):
w[i]=wo[2*i+1]
|
M=100;
w=0.21557895-0.41663158*cos(pi*(2*(0:M-1)+1)/M)+0.277263158*cos(2*pi*(2*(0:M-1)+1)/M)-0.083578947*cos(3*pi*(2*(0:M-1)+1)/M)+0.006947368*cos(4*pi*(2*(0:M-1)+1)/M);
oder
M=100;
wo=flattopwin(2*M+1);
w=zeros(1,M);
for i=1:M
w(i)=wo(2*i);
end
|
Lanczos-Fenster (Riemann-Fenster, Daniell-Fenster) |
|
M=100
w=M*sin(pi*(2*arange(0,M)-M+1)/float(M))/(pi*(2*arange(0,M)-M+1))
|
M=100;
w=M*sin(pi*(2*(0:M-1)-M+1)/M)./(pi*(2*(0:M-1)-M+1));
|
Kaiser-Fenster |
|
M=100
beta=7.5
w=i0(beta*sqrt(1-((2*arange(0,M)-M+1)/float(M))**2))/i0(beta)
oder
M=100
wo=kaiser(2*M+1,beta)
w=zeros(M)
for i in range(0,M):
w[i]=wo[2*i+1]
|
M=100;
beta=7.5;
w=real(besseli(0,beta*sqrt(1-((2*(0:M-1)-M+1)/M).^2))/besseli(0,beta));
oder
M=100;
wo=kaiser(2*M+1,beta);
w=zeros(1,M);
for i=1:M
w(i)=wo(2*i);
end
|
Gauß-Fenster |
|
M=100
sigma=15.0
w=exp(-(2*arange(0,M)-M-1)**2/(8*sigma**2))
|
M=100;
sigma=15.0;
w=exp(-(2*(0:M-1)-M+1).^2/(8*sigma^2));
|