24
24
25
25
# # === FUNCTIONS == ##
26
26
27
- # # === FUNCTIONS == ##
28
27
for (T, suff) in ((Float64, " D" ), (Float32, " " ))
29
28
30
29
"""
@@ -198,6 +197,50 @@ for (T, suff) in ((Float64, "D"), )
198
197
end
199
198
200
199
# # == WINDOW GENERATION == ##
200
+
201
+ """
202
+ blackman(length, [rtype=Float64])
203
+
204
+ Generates a Blackman window of length 'length'. Default return type
205
+ is Vector{Float64}, but if rtype=Float32, Vector{Float32}
206
+ will be returned.
207
+ """
208
+ function blackman (length:: Int , rtype:: DataType = Float64)
209
+ result:: Vector{rtype} = Array {rtype} (undef, length)
210
+ blackman! (result, length, 0 )
211
+ end
212
+
213
+ """
214
+ hamming(length, [rtype=Float64])
215
+
216
+ Generates a Hamming window of length 'length'. Default return type
217
+ is Vector{Float64}, but if rtype=Float32, Vector{Float32}
218
+ will be returned.
219
+ """
220
+ function hamming (length:: Int , rtype:: DataType = Float64)
221
+ result:: Vector{rtype} = Array {rtype} (undef, length)
222
+ hamming! (result, length, 0 )
223
+ end
224
+
225
+ """
226
+ hanning(length, [rtype=Float64])
227
+
228
+ Generates a denormalized Hanning window of length 'length'. Default
229
+ return type is Vector{Float64}, but if rtype=Float32, Vector{Float32}
230
+ will be returned.
231
+ """
232
+ function hanning (length:: Int , rtype:: DataType = Float64)
233
+ result:: Vector{rtype} = Array {rtype} (undef, length)
234
+ hanning! (result, length, 0 )
235
+ end
236
+
237
+ """
238
+ Alias function for `hanning`
239
+ """
240
+ function hann (length:: Int , rtype:: DataType = Float64)
241
+ hanning (length, rtype)
242
+ end
243
+
201
244
for (T, suff) in ((Float32, " " ), (Float64, " D" ))
202
245
203
246
"""
@@ -216,19 +259,6 @@ for (T, suff) in ((Float32, ""), (Float64, "D"))
216
259
end
217
260
end
218
261
219
- """
220
- Generates a Blackman window of length 'length'. Default return type
221
- is Vector{Float64}, but if rtype=Float32, Vector{Float32}
222
- will be returned.
223
-
224
- Returns: Vector{$T }
225
- """
226
- @eval begin
227
- function blackman (length:: Int , rtype:: DataType = Float64)
228
- result:: Vector{rtype} = Array {rtype} (undef, length)
229
- blackman! (result, length, 0 )
230
- end
231
- end
232
262
233
263
"""
234
264
Generates a Hamming window of length 'length' and stores it in `result'. By
@@ -246,21 +276,6 @@ for (T, suff) in ((Float32, ""), (Float64, "D"))
246
276
end
247
277
end
248
278
249
- """
250
- Generates a Hamming window of length 'length'. Default return type
251
- is Vector{Float64}, but if rtype=Float32, Vector{Float32}
252
- will be returned.
253
-
254
- Returns: Vector{$T }
255
- """
256
- @eval begin
257
- function hamming (length:: Int , rtype:: DataType = Float64)
258
- result:: Vector{rtype} = Array {rtype} (undef, length)
259
- hamming! (result, length, 0 )
260
- end
261
- end
262
-
263
-
264
279
"""
265
280
Generates a Hanning window of length 'length' and stores it in `result'.
266
281
Different window options can be set using the flag argument; default value
@@ -282,20 +297,6 @@ for (T, suff) in ((Float32, ""), (Float64, "D"))
282
297
end
283
298
end
284
299
285
- """
286
- Generates a denormalized Hanning window of length 'length'. Default
287
- return type is Vector{Float64}, but if rtype=Float32, Vector{Float32}
288
- will be returned.
289
-
290
- Returns: Vector{$T }
291
- """
292
- @eval begin
293
- function hanning (length:: Int , rtype:: DataType = Float64)
294
- result:: Vector{rtype} = Array {rtype} (undef, length)
295
- hanning! (result, length, 0 )
296
- end
297
- end
298
-
299
300
"""
300
301
Alias function for hanning!
301
302
@@ -307,17 +308,6 @@ for (T, suff) in ((Float32, ""), (Float64, "D"))
307
308
end
308
309
end
309
310
310
- """
311
- Alias function for hanning
312
-
313
- Returns: Vector{$T }
314
- """
315
- @eval begin
316
- function hann (length:: Int , rtype:: DataType = Float64)
317
- hanning (length, rtype)
318
- end
319
- end
320
-
321
311
end
322
312
323
313
0 commit comments