Wednesday, June 10, 2026
HomeLanguageskaiser in Numpy – Python

kaiser in Numpy – Python

Kaiser window is a taper formed by using a Bessel function.

Syntax : numpy.kaiser(M, beta)

Parameters :
M : [int] Number of points in the output window. If zero or less, an empty array is returned.
beta : [float] Shape parameter for window.

Returns:
out : [array] The window, with the maximum value normalized to one (the value one appears only if the number of samples is odd).

Example:




import numpy as np 
    
print(np.kaiser(12, 14)) 


Output:

[  7.72686684e-06   3.46009194e-03   4.65200189e-02   2.29737120e-01
   5.99885316e-01   9.45674898e-01   9.45674898e-01   5.99885316e-01
   2.29737120e-01   4.65200189e-02   3.46009194e-03   7.72686684e-06]

Plotting the window and its frequency response –

For Window :




import numpy as np 
import matplotlib.pyplot as plt 
from numpy.fft import fft, fftshift 
   
window = np.kaiser(51, 14)
   
plt.plot(window) 
plt.title("Kaiser window")
plt.ylabel("Amplitude"
plt.xlabel("Sample"
plt.show() 


Output:

For frequency :




import numpy as np 
import matplotlib.pyplot as plt 
from numpy.fft import fft, fftshift 
    
window = np.kaiser(51, 14)
plt.figure() 
    
A = fft(window, 2048) / 25.5
mag = np.abs(fftshift(A)) 
freq = np.linspace(-0.5, 0.5, len(A)) 
response = 20 * np.log10(mag) 
response = np.clip(response, -100, 100
    
plt.plot(freq, response) 
plt.title("Frequency response of Kaiser window"
plt.ylabel("Magnitude [dB]"
plt.xlabel("Normalized frequency [cycles per sample]"
plt.axis("tight"
plt.show() 


Output:

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

3 COMMENTS

Most Popular

Dominic
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6896 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6963 POSTS0 COMMENTS