Skip to content

Commit 08418ec

Browse files
committed
rename hanning to hann
1 parent 16f7498 commit 08418ec

File tree

12 files changed

+46
-46
lines changed

12 files changed

+46
-46
lines changed

Diff for: CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unreleased
22

3-
*No unreleased changes as of yet.*
3+
- Renamed `window-hanning` to `window-hann`
44

55
---
66

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ within this repository:
3636
| [**`dasp_rms`**][dasp_rms] | [![Crates.io][dasp_rms-crates-io-svg]][dasp_rms-crates-io] [![docs.rs][dasp_rms-docs-rs-svg]][dasp_rms-docs-rs] | RMS detection with configurable window. |
3737
| [**`dasp_envelope`**][dasp_envelope] | [![Crates.io][dasp_envelope-crates-io-svg]][dasp_envelope-crates-io] [![docs.rs][dasp_envelope-docs-rs-svg]][dasp_envelope-docs-rs] | Envelope detection with peak and RMS impls. |
3838
| [**`dasp_interpolate`**][dasp_interpolate] | [![Crates.io][dasp_interpolate-crates-io-svg]][dasp_interpolate-crates-io] [![docs.rs][dasp_interpolate-docs-rs-svg]][dasp_interpolate-docs-rs] | Inter-frame rate interpolation (linear, sinc, etc). |
39-
| [**`dasp_window`**][dasp_window] | [![Crates.io][dasp_window-crates-io-svg]][dasp_window-crates-io] [![docs.rs][dasp_window-docs-rs-svg]][dasp_window-docs-rs] | Windowing function abstraction (hanning, rectangle). |
39+
| [**`dasp_window`**][dasp_window] | [![Crates.io][dasp_window-crates-io-svg]][dasp_window-crates-io] [![docs.rs][dasp_window-docs-rs-svg]][dasp_window-docs-rs] | Windowing function abstraction (hann, rectangle). |
4040
| [**`dasp_signal`**][dasp_signal] | [![Crates.io][dasp_signal-crates-io-svg]][dasp_signal-crates-io] [![docs.rs][dasp_signal-docs-rs-svg]][dasp_signal-docs-rs] | Iterator-like API for streams of audio frames. |
4141

4242
[![deps-graph][deps-graph]][deps-graph]

Diff for: dasp/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ all-no-std = [
4242
"signal-envelope",
4343
"signal-rms",
4444
"signal-window",
45-
"signal-window-hanning",
45+
"signal-window-hann",
4646
"signal-window-rectangle",
4747
"slice",
4848
"slice-boxed",
4949
"window",
50-
"window-hanning",
50+
"window-hann",
5151
"window-rectangle",
5252
]
5353
std = [
@@ -78,12 +78,12 @@ signal-bus = ["dasp_signal/bus"]
7878
signal-envelope = ["dasp_signal/envelope", "envelope"]
7979
signal-rms = ["dasp_signal/rms", "rms"]
8080
signal-window = ["dasp_signal/window", "window"]
81-
signal-window-hanning = ["dasp_signal/window-hanning", "window-hanning"]
81+
signal-window-hann = ["dasp_signal/window-hann", "window-hann"]
8282
signal-window-rectangle = ["dasp_signal/window-rectangle", "window-rectangle"]
8383
slice = ["dasp_slice"]
8484
slice-boxed = ["dasp_slice/boxed"]
8585
window = ["dasp_window"]
86-
window-hanning = ["dasp_window/hanning"]
86+
window-hann = ["dasp_window/hann"]
8787
window-rectangle = ["dasp_window/rectangle"]
8888

8989
[package.metadata.docs.rs]

Diff for: dasp/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@
6161
//! trait.
6262
//! - The **signal-window** feature enables the
6363
//! [**signal::window**](./signal/window/index.html) module.
64-
//! - The **signal-window-hanning** enables the
65-
//! [**signal::window::hanning**](./signal/window/fn.hanning.html) window constructor.
64+
//! - The **signal-window-hann** enables the
65+
//! [**signal::window::hann**](./signal/window/fn.hann.html) window constructor.
6666
//! - The **signal-window-rectangle** enables the
6767
//! [**signal::window::rectangle**](./signal/window/fn.rectangle.html) window constructor.
6868
//! - The **slice** feature enables the `dasp_slice` crate via the [slice](./slice/index.html)
6969
//! module.
7070
//! - The **slice-boxed** feature enables boxed slice conversion traits and functions.
7171
//! - The **window** feature enables the `dasp_window` crate via the [window](./window/index.html)
7272
//! module.
73-
//! - The **window-hanning** feature enables the [**Hanning**](./window/struct.Hanning.html)
73+
//! - The **window-hann** feature enables the [**Hann**](./window/struct.Hann.html)
7474
//! window implementation.
7575
//! - The **window-rectangle** feature enables the
7676
//! [**Rectangle**](./window/struct.Rectangle.html) window implementation.

Diff for: dasp_signal/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dasp_window = { version = "0.11", path = "../dasp_window", default-features = fa
2323
[dev-dependencies]
2424
dasp_envelope = { version = "0.11", path = "../dasp_envelope", default-features = false, features = ["peak"] }
2525
dasp_interpolate = { version = "0.11", path = "../dasp_interpolate", default-features = false, features = ["floor", "linear", "sinc"] }
26-
dasp_window = { version = "0.11", path = "../dasp_window", default-features = false, features = ["hanning"] }
26+
dasp_window = { version = "0.11", path = "../dasp_window", default-features = false, features = ["hann"] }
2727

2828
[features]
2929
default = ["std"]
@@ -34,7 +34,7 @@ all-no-std = [
3434
"envelope",
3535
"rms",
3636
"window",
37-
"window-hanning",
37+
"window-hann",
3838
"window-rectangle",
3939
]
4040
std = [
@@ -52,7 +52,7 @@ bus = []
5252
envelope = ["dasp_envelope"]
5353
rms = ["dasp_rms"]
5454
window = ["dasp_window"]
55-
window-hanning = ["dasp_window/hanning"]
55+
window-hann = ["dasp_window/hann"]
5656
window-rectangle = ["dasp_window/rectangle"]
5757

5858
[package.metadata.docs.rs]

Diff for: dasp_signal/src/window/hanning.rs renamed to dasp_signal/src/window/hann.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
use super::{Window, Windower};
22
use dasp_frame::Frame;
3-
use dasp_window::Hanning;
3+
use dasp_window::Hann;
44

5-
impl<'a, F> Windower<'a, F, Hanning>
5+
impl<'a, F> Windower<'a, F, Hann>
66
where
77
F: 'a + Frame,
88
{
9-
/// Constructor for a `Windower` using the `Hanning` window function.
9+
/// Constructor for a `Windower` using the `Hann` window function.
1010
///
1111
/// ### Required Features
1212
///
13-
/// - When using `dasp_signal`, this item requires the **window-hanning** feature to be enabled.
14-
/// - When using `dasp`, this item requires the **signal-window-hanning** feature to be enabled.
15-
pub fn hanning(frames: &'a [F], bin: usize, hop: usize) -> Self {
13+
/// - When using `dasp_signal`, this item requires the **window-hann** feature to be enabled.
14+
/// - When using `dasp`, this item requires the **signal-window-hann** feature to be enabled.
15+
pub fn hann(frames: &'a [F], bin: usize, hop: usize) -> Self {
1616
Windower::new(frames, bin, hop)
1717
}
1818
}
1919

20-
/// A helper function for constructing a `Window` that uses a `Hanning` `Type` function.
20+
/// A helper function for constructing a `Window` that uses a `Hann` `Type` function.
2121
///
2222
/// ### Required Features
2323
///
24-
/// - When using `dasp_signal`, this item requires the **window-hanning** feature to be enabled.
25-
/// - When using `dasp`, this item requires the **signal-window-hanning** feature to be enabled.
26-
pub fn hanning<F>(num_frames: usize) -> Window<F, Hanning>
24+
/// - When using `dasp_signal`, this item requires the **window-hann** feature to be enabled.
25+
/// - When using `dasp`, this item requires the **signal-window-hann** feature to be enabled.
26+
pub fn hann<F>(num_frames: usize) -> Window<F, Hann>
2727
where
2828
F: Frame,
2929
{

Diff for: dasp_signal/src/window/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use dasp_frame::Frame;
66
use dasp_sample::Sample;
77
use dasp_window::Window as WindowType;
88

9-
#[cfg(feature = "window-hanning")]
10-
pub use hanning::hanning;
9+
#[cfg(feature = "window-hann")]
10+
pub use hann::hann;
1111
#[cfg(feature = "window-rectangle")]
1212
pub use rectangle::rectangle;
1313

14-
#[cfg(feature = "window-hanning")]
15-
mod hanning;
14+
#[cfg(feature = "window-hann")]
15+
mod hann;
1616
#[cfg(feature = "window-rectangle")]
1717
mod rectangle;
1818

Diff for: dasp_signal/tests/window.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
use dasp_frame::Frame;
44
use dasp_signal::window::{self, Windower};
55

6-
#[cfg(feature = "window-hanning")]
6+
#[cfg(feature = "window-hann")]
77
#[test]
88
fn test_window_at_phase() {
9-
let window = window::hanning::<f64>(9);
9+
let window = window::hann::<f64>(9);
1010
let expected = [
1111
0.0, 0.1464, 0.5000, 0.8536, 1., 0.8536, 0.5000, 0.1464, 0., 0.1464,
1212
];
@@ -39,11 +39,11 @@ fn test_windower() {
3939
}
4040
}
4141

42-
#[cfg(feature = "window-hanning")]
42+
#[cfg(feature = "window-hann")]
4343
#[test]
4444
fn test_window_size() {
4545
let v = [1f32; 16];
46-
let windows: Vec<Vec<_>> = Windower::hanning(&v, 8, 4)
46+
let windows: Vec<Vec<_>> = Windower::hann(&v, 8, 4)
4747
.map(|i| i.take(8).collect::<Vec<f32>>())
4848
.take(3)
4949
.collect();

Diff for: dasp_window/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
name = "dasp_window"
3-
description = "Windowing function abstractions (e.g. hanning, rectangle) for audio PCM DSP."
3+
description = "Windowing function abstractions (e.g. hann, rectangle) for audio PCM DSP."
44
version = "0.11.0"
55
authors = ["mitchmindtree <[email protected]>"]
66
readme = "../README.md"
7-
keywords = ["dsp", "window", "hanning", "pcm", "audio"]
7+
keywords = ["dsp", "window", "hann", "pcm", "audio"]
88
license = "MIT OR Apache-2.0"
99
repository = "https://github.com/rustaudio/dasp.git"
1010
homepage = "https://github.com/rustaudio/dasp"
@@ -17,13 +17,13 @@ dasp_sample = { version = "0.11", path = "../dasp_sample", default-features = fa
1717
default = ["std"]
1818
all = ["std", "all-no-std"]
1919
all-no-std = [
20-
"hanning",
20+
"hann",
2121
"rectangle",
2222
]
2323
std = [
2424
"dasp_sample/std",
2525
]
26-
hanning = []
26+
hann = []
2727
rectangle = []
2828

2929
[package.metadata.docs.rs]

Diff for: dasp_window/src/hanning/mod.rs renamed to dasp_window/src/hann/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ mod ops;
66

77
/// A type of window function, also known as the "raised cosine window".
88
///
9-
/// [Wiki entry](https://en.wikipedia.org/wiki/Window_function#Hann_.28Hanning.29_window).
9+
/// [Wiki entry](https://en.wikipedia.org/wiki/Hann_function).
1010
///
1111
/// ### Required Features
1212
///
13-
/// - When using `dasp_window`, this item requires the **hanning** feature to be enabled.
14-
/// - When using `dasp`, this item requires the **window-hanning** feature to be enabled.
13+
/// - When using `dasp_window`, this item requires the **hann** feature to be enabled.
14+
/// - When using `dasp`, this item requires the **window-hann** feature to be enabled.
1515
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
16-
pub struct Hanning;
16+
pub struct Hann;
1717

18-
impl<S> Window<S> for Hanning
18+
impl<S> Window<S> for Hann
1919
where
2020
S: Sample,
2121
{
File renamed without changes.

Diff for: dasp_window/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//! Module for windowing over a batch of Frames. Includes default Hanning and Rectangle window
1+
//! Module for windowing over a batch of Frames. Includes default Hann and Rectangle window
22
//! types.
33
//!
44
//! ### Optional Features
55
//!
6-
//! - The **hanning** feature (or **window-hanning** feature if using `dasp`) provides the
7-
//! [**Hanning**](./struct.Hanning.html) window function implementation.
6+
//! - The **hann** feature (or **window-hann** feature if using `dasp`) provides the
7+
//! [**Hann**](./struct.Hann.html) window function implementation.
88
//! - The **rectangle** feature (or **window-rectangle** feature if using `dasp`) provides the
99
//! [**Rectangle**](./struct.Rectangle.html) window function implementation.
1010
//!
@@ -18,13 +18,13 @@
1818
#![cfg_attr(not(feature = "std"), no_std)]
1919
#![cfg_attr(not(feature = "std"), feature(core_intrinsics))]
2020

21-
#[cfg(feature = "hanning")]
22-
pub use hanning::Hanning;
21+
#[cfg(feature = "hann")]
22+
pub use hann::Hann;
2323
#[cfg(feature = "rectangle")]
2424
pub use rectangle::Rectangle;
2525

26-
#[cfg(feature = "hanning")]
27-
mod hanning;
26+
#[cfg(feature = "hann")]
27+
mod hann;
2828
#[cfg(feature = "rectangle")]
2929
mod rectangle;
3030

0 commit comments

Comments
 (0)