Skip to content

Commit 327137d

Browse files
committed
Minor nitpicks
1 parent 302ba72 commit 327137d

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

lib/nx_signal.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule NxSignal do
22
@moduledoc """
3-
Nx library extension for DSP
3+
Nx library extension for digital signal processing.
44
"""
55

66
import Nx.Defn
@@ -85,7 +85,7 @@ defmodule NxSignal do
8585
stft_n(data, window, sampling_rate, Keyword.put(opts, :overlap_length, overlap_length))
8686
end
8787

88-
defnp stft_n(data, window, sampling_rate, opts \\ []) do
88+
defnp stft_n(data, window, sampling_rate, opts) do
8989
{frame_length} = Nx.shape(window)
9090
padding = opts[:window_padding]
9191
fft_length = opts[:fft_length]
@@ -252,16 +252,16 @@ defmodule NxSignal do
252252
end
253253
end
254254

255-
deftransformp as_windowed_parse_opts(shape, opts, :reflect) do
255+
deftransformp as_windowed_parse_reflect_opts(shape, opts) do
256256
window_length = opts[:window_length]
257257

258-
as_windowed_parse_opts(
258+
as_windowed_parse_non_reflect_opts(
259259
shape,
260260
Keyword.put(opts, :padding, [{div(window_length, 2), div(window_length, 2) - 1}])
261261
)
262262
end
263263

264-
deftransformp as_windowed_parse_opts(shape, opts) do
264+
deftransformp as_windowed_parse_non_reflect_opts(shape, opts) do
265265
opts = Keyword.validate!(opts, [:window_length, padding: :valid, stride: 1])
266266
window_length = opts[:window_length]
267267
window_dimensions = {window_length}
@@ -331,7 +331,7 @@ defmodule NxSignal do
331331
defnp as_windowed_non_reflect_padding(tensor, opts \\ []) do
332332
# current implementation only supports windowing 1D tensors
333333
{window_length, stride, padding, output_shape} =
334-
as_windowed_parse_opts(Nx.shape(tensor), opts)
334+
as_windowed_parse_non_reflect_opts(Nx.shape(tensor), opts)
335335

336336
output = Nx.broadcast(Nx.tensor(0, type: tensor.type), output_shape)
337337
{num_windows, _} = Nx.shape(output)
@@ -356,7 +356,7 @@ defmodule NxSignal do
356356
defnp as_windowed_reflect_padding(tensor, opts \\ []) do
357357
# current implementation only supports windowing 1D tensors
358358
{window_length, stride, _padding, output_shape} =
359-
as_windowed_parse_opts(Nx.shape(tensor), opts, :reflect)
359+
as_windowed_parse_reflect_opts(Nx.shape(tensor), opts)
360360

361361
output = Nx.broadcast(Nx.tensor(0, type: tensor.type), output_shape)
362362
{num_windows, _} = Nx.shape(output)
@@ -489,7 +489,7 @@ defmodule NxSignal do
489489
)
490490
end
491491

492-
defnp mel_filters_n(sampling_rate, max_mel, f_sp, opts \\ []) do
492+
defnp mel_filters_n(sampling_rate, max_mel, f_sp, opts) do
493493
fft_length = opts[:fft_length]
494494
mel_bins = opts[:mel_bins]
495495
type = opts[:type]

lib/nx_signal/filters.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule NxSignal.Filters do
22
@moduledoc """
3-
Common filter functions
3+
Common filter functions.
44
"""
55
import Nx.Defn
66

lib/nx_signal/windows.ex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
defmodule NxSignal.Windows do
22
@moduledoc """
3-
Common window functions
3+
Common window functions.
44
"""
55
import Nx.Defn
66

77
@pi :math.pi()
88

99
@doc """
10-
Rectangular window
10+
Rectangular window.
1111
1212
Useful for when no window function should be applied.
1313
@@ -38,7 +38,7 @@ defmodule NxSignal.Windows do
3838
end
3939

4040
@doc """
41-
Bartlett triangular window
41+
Bartlett triangular window.
4242
4343
See also: `triangular/1`
4444
@@ -75,7 +75,7 @@ defmodule NxSignal.Windows do
7575
end
7676

7777
@doc """
78-
Triangular window
78+
Triangular window.
7979
8080
See also: `bartlett/1`
8181
@@ -122,7 +122,7 @@ defmodule NxSignal.Windows do
122122
end
123123

124124
@doc """
125-
Blackman window
125+
Blackman window.
126126
127127
## Options
128128
@@ -190,7 +190,7 @@ defmodule NxSignal.Windows do
190190
end
191191

192192
@doc """
193-
Hamming window
193+
Hamming window.
194194
195195
## Options
196196
@@ -240,7 +240,7 @@ defmodule NxSignal.Windows do
240240
end
241241

242242
@doc """
243-
Hann window
243+
Hann window.
244244
245245
## Options
246246

0 commit comments

Comments
 (0)