@@ -81,15 +81,15 @@ def _call_window_kernel(
81
81
return result
82
82
83
83
84
- def blackman (M , device = None , usm_type = None , sycl_queue = None ):
84
+ def bartlett (M , device = None , usm_type = None , sycl_queue = None ):
85
85
r"""
86
- Return the Blackman window.
86
+ Return the Bartlett window.
87
87
88
- The Blackman window is a taper formed by using the first three terms of a
89
- summation of cosines . It was designed to have close to the minimal leakage
90
- possible. It is close to optimal, only slightly worse than a Kaiser window .
88
+ The Bartlett window is very similar to a triangular window, except that the
89
+ end points are at zero . It is often used in signal processing for tapering
90
+ a signal, without generating too much ripple in the frequency domain .
91
91
92
- For full documentation refer to :obj:`numpy.blackman `.
92
+ For full documentation refer to :obj:`numpy.bartlett `.
93
93
94
94
Parameters
95
95
----------
@@ -120,69 +120,70 @@ def blackman(M, device=None, usm_type=None, sycl_queue=None):
120
120
Returns
121
121
-------
122
122
out : dpnp.ndarray of shape (M,)
123
- The window, with the maximum value normalized to one (the value one
124
- appears only if the number of samples is odd).
123
+ The triangular window, with the maximum value normalized to one
124
+ (the value one appears only if the number of samples is odd), with the
125
+ first and last samples equal to zero.
125
126
126
127
See Also
127
128
--------
128
- :obj:`dpnp.bartlett ` : Return the Bartlett window.
129
+ :obj:`dpnp.blackman ` : Return the Blackman window.
129
130
:obj:`dpnp.hamming` : Return the Hamming window.
130
131
:obj:`dpnp.hanning` : Return the Hanning window.
131
132
:obj:`dpnp.kaiser` : Return the Kaiser window.
132
133
133
134
Notes
134
135
-----
135
- The Blackman window is defined as
136
+ The Bartlett window is defined as
136
137
137
- .. math:: w(n) = 0.42 - 0.5\cos\ left(\frac{2\pi{n}}{ M-1}\right)
138
- + 0.08\cos\ left( \frac{4\pi{n}}{ M-1}\right)
138
+ .. math:: w(n) = \frac{2}{M-1} \ left(\frac{M-1}{2} -
139
+ \ left|n - \frac{M-1}{2}\right| \right)
139
140
\qquad 0 \leq n \leq M-1
140
141
141
142
Examples
142
143
--------
143
144
>>> import dpnp as np
144
- >>> np.blackman (12)
145
- array([-1.38777878e-17, 3.26064346e-02, 1.59903635e-01, 4.14397981e-01 ,
146
- 7.36045180e-01, 9.67046769e-01, 9.67046769e-01, 7.36045180e-01 ,
147
- 4.14397981e-01, 1.59903635e-01, 3.26064346e-02, -1.38777878e-17 ])
145
+ >>> np.bartlett (12)
146
+ array([0. , 0.18181818, 0.36363636, 0.54545455, 0.72727273 ,
147
+ 0.90909091, 0.90909091, 0.72727273, 0.54545455, 0.36363636 ,
148
+ 0.18181818, 0. ])
148
149
149
150
Creating the output array on a different device or with a
150
151
specified usm_type:
151
152
152
- >>> x = np.blackman(3 ) # default case
153
+ >>> x = np.bartlett(4 ) # default case
153
154
>>> x, x.device, x.usm_type
154
- (array([-1.38777878e-17, 1.00000000e+00, -1.38777878e-17 ]),
155
+ (array([0. , 0.66666667, 0.66666667, 0. ]),
155
156
Device(level_zero:gpu:0),
156
157
'device')
157
158
158
- >>> y = np.blackman(3 , device="cpu")
159
+ >>> y = np.bartlett(4 , device="cpu")
159
160
>>> y, y.device, y.usm_type
160
- (array([-1.38777878e-17, 1.00000000e+00, -1.38777878e-17 ]),
161
+ (array([0. , 0.66666667, 0.66666667, 0. ]),
161
162
Device(opencl:cpu:0),
162
163
'device')
163
164
164
- >>> z = np.blackman(3 , usm_type="host")
165
+ >>> z = np.bartlett(4 , usm_type="host")
165
166
>>> z, z.device, z.usm_type
166
- (array([-1.38777878e-17, 1.00000000e+00, -1.38777878e-17 ]),
167
+ (array([0. , 0.66666667, 0.66666667, 0. ]),
167
168
Device(level_zero:gpu:0),
168
169
'host')
169
170
170
171
"""
171
172
172
173
return _call_window_kernel (
173
- M , wi ._blackman , device = device , usm_type = usm_type , sycl_queue = sycl_queue
174
+ M , wi ._bartlett , device = device , usm_type = usm_type , sycl_queue = sycl_queue
174
175
)
175
176
176
177
177
- def bartlett (M , device = None , usm_type = None , sycl_queue = None ):
178
+ def blackman (M , device = None , usm_type = None , sycl_queue = None ):
178
179
r"""
179
- Return the Bartlett window.
180
+ Return the Blackman window.
180
181
181
- The Bartlett window is very similar to a triangular window, except that the
182
- end points are at zero . It is often used in signal processing for tapering
183
- a signal, without generating too much ripple in the frequency domain .
182
+ The Blackman window is a taper formed by using the first three terms of a
183
+ summation of cosines . It was designed to have close to the minimal leakage
184
+ possible. It is close to optimal, only slightly worse than a Kaiser window .
184
185
185
- For full documentation refer to :obj:`numpy.bartlett `.
186
+ For full documentation refer to :obj:`numpy.blackman `.
186
187
187
188
Parameters
188
189
----------
@@ -213,57 +214,57 @@ def bartlett(M, device=None, usm_type=None, sycl_queue=None):
213
214
Returns
214
215
-------
215
216
out : dpnp.ndarray of shape (M,)
216
- The triangular window, with the maximum value normalized to one
217
- (the value one appears only if the number of samples is odd), with the
218
- first and last samples equal to zero.
217
+ The window, with the maximum value normalized to one (the value one
218
+ appears only if the number of samples is odd).
219
219
220
220
See Also
221
221
--------
222
- :obj:`dpnp.blackman ` : Return the Blackman window.
222
+ :obj:`dpnp.bartlett ` : Return the Bartlett window.
223
223
:obj:`dpnp.hamming` : Return the Hamming window.
224
224
:obj:`dpnp.hanning` : Return the Hanning window.
225
225
:obj:`dpnp.kaiser` : Return the Kaiser window.
226
226
227
227
Notes
228
228
-----
229
- The Bartlett window is defined as
229
+ The Blackman window is defined as
230
230
231
- .. math:: w(n) = \frac{2}{M-1} \left(\frac{M-1}{2} -
232
- \left|n - \frac{M-1}{2}\right|\right)
231
+ .. math:: w(n) = 0.42 - 0.5\cos\left(\frac{2\pi{n}}{M-1}\right)
232
+ + 0.08\cos\left(\frac{4\pi{n}}{M-1}\right)
233
+ \qquad 0 \leq n \leq M-1
233
234
234
235
Examples
235
236
--------
236
237
>>> import dpnp as np
237
- >>> np.bartlett (12)
238
- array([0. , 0.18181818, 0.36363636, 0.54545455, 0.72727273 ,
239
- 0.90909091, 0.90909091, 0.72727273, 0.54545455, 0.36363636 ,
240
- 0.18181818, 0. ])
238
+ >>> np.blackman (12)
239
+ array([-1.38777878e-17, 3.26064346e-02, 1.59903635e-01, 4.14397981e-01 ,
240
+ 7.36045180e-01, 9.67046769e-01, 9.67046769e-01, 7.36045180e-01 ,
241
+ 4.14397981e-01, 1.59903635e-01, 3.26064346e-02, -1.38777878e-17 ])
241
242
242
243
Creating the output array on a different device or with a
243
244
specified usm_type:
244
245
245
- >>> x = np.bartlett(4 ) # default case
246
+ >>> x = np.blackman(3 ) # default case
246
247
>>> x, x.device, x.usm_type
247
- (array([0. , 0.66666667, 0.66666667, 0. ]),
248
+ (array([-1.38777878e-17, 1.00000000e+00, -1.38777878e-17 ]),
248
249
Device(level_zero:gpu:0),
249
250
'device')
250
251
251
- >>> y = np.bartlett(4 , device="cpu")
252
+ >>> y = np.blackman(3 , device="cpu")
252
253
>>> y, y.device, y.usm_type
253
- (array([0. , 0.66666667, 0.66666667, 0. ]),
254
+ (array([-1.38777878e-17, 1.00000000e+00, -1.38777878e-17 ]),
254
255
Device(opencl:cpu:0),
255
256
'device')
256
257
257
- >>> z = np.bartlett(4 , usm_type="host")
258
+ >>> z = np.blackman(3 , usm_type="host")
258
259
>>> z, z.device, z.usm_type
259
- (array([0. , 0.66666667, 0.66666667, 0. ]),
260
+ (array([-1.38777878e-17, 1.00000000e+00, -1.38777878e-17 ]),
260
261
Device(level_zero:gpu:0),
261
262
'host')
262
263
263
264
"""
264
265
265
266
return _call_window_kernel (
266
- M , wi ._bartlett , device = device , usm_type = usm_type , sycl_queue = sycl_queue
267
+ M , wi ._blackman , device = device , usm_type = usm_type , sycl_queue = sycl_queue
267
268
)
268
269
269
270
0 commit comments