Skip to content

Commit

Permalink
Merge pull request #64 from sp-nitech/format
Browse files Browse the repository at this point in the history
Format
  • Loading branch information
takenori-y authored Jul 23, 2024
2 parents 431de77 + 748e391 commit 36cf677
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 427 deletions.
693 changes: 334 additions & 359 deletions CMakeLists.txt

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Contributing guide
==================
# Contributing guide

Thank you for your interest in contributing to SPTK.

Any kinds of contributions are welcome.

## Development

Development
-----------
For the development of SPTK, you may need to install the following programs:

- [Bison](http://ftp.gnu.org/gnu/bison/)
Expand All @@ -17,28 +15,36 @@ For the development of SPTK, you may need to install the following programs:
- Valgrind

Then you can setup the development environment of SPTK by running

```sh
cd tools
make
```

### Unit testing

SPTK provides a unit testing framework.
Please perform unit testing before sending a pull request by running

```sh
make test
```

### Source code formatting

`ClangFormat` and `cpplint` are used to format source codes.
Please also perform the formatting before sending a pull request by running

```sh
make format
```

### Document generation

You can generate the SPTK reference manual as follows:

```sh
make doc
```

The generated manual is in `doc/_build/html/`.
9 changes: 7 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Installation
------------
## Installation

### Linux / macOS

If you do not care about build options, simply run:

```sh
make
```

in Terminal.

If you would like to customize build options, follow the below procedure:

```sh
mkdir build
cd build
Expand All @@ -20,12 +22,15 @@ make -j 4 install
### Windows

If you do not care about build options, simply run:

```sh
make.bat
```

in DOS prompt.

If you would like to customize build options, follow the below procedure:

```sh
mkdir build
cd build
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ doc-clean:
. ./tools/venv/bin/activate && cd $(DOCDIR) && make clean; \
fi

format: format-sh format-py format-cc
format: format-sh format-py format-cc format-misc

format-sh:
@if [ ! -x ./tools/shellcheck/shellcheck ]; then \
Expand Down Expand Up @@ -101,6 +101,17 @@ format-cc:
./tools/venv/bin/cpplint --filter=-readability/streams,-build/include_subdir \
--root=$(abspath $(INCLUDEDIR)) $(wildcard $(INCLUDEDIR)/SPTK/*/*.h)

format-misc:
@if [ ! -x ./tools/venv/bin/cmake-format ]; then \
echo "Please install cmake-format via:"; \
echo ""; \
echo " cd tools; make venv_dev"; \
echo ""; \
exit 1; \
fi
./tools/venv/bin/cmake-format -i CMakeLists.txt
./tools/venv/bin/mdformat *.md

test:
@if [ ! -x ./tools/bats/bin/bats ]; then \
echo "Please install bats via:"; \
Expand Down
117 changes: 56 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SPTK
====
# SPTK

The Speech Signal Processing Toolkit (SPTK) is a software for speech signal processing tools.

- Older version: [SPTK3](https://sourceforge.net/projects/sp-tk/)
Expand All @@ -10,9 +10,8 @@ The Speech Signal Processing Toolkit (SPTK) is a software for speech signal proc
[![](https://img.shields.io/badge/license-Apache%202.0-green.svg)](https://github.com/sp-nitech/SPTK/blob/master/LICENSE)
[![](https://github.com/sp-nitech/SPTK/workflows/build/badge.svg)](https://github.com/sp-nitech/SPTK/actions)

## What is SPTK?

What is SPTK?
-------------
- SPTK consists of over 100 commands for speech signal processing.
- The data format used in SPTK is raw header-less, i.e., there is no specific structure.
Thanks to the data format, we can check file contents immediately on CUI.
Expand All @@ -31,33 +30,31 @@ What is SPTK?
impulse -l 4 | sopr -m 10 | x2x +da
```

## Documentation

Documentation
-------------
- See [this page](https://sp-nitech.github.io/sptk/latest/) for a reference manual.
- Our [paper](https://www.isca-speech.org/archive/ssw_2023/yoshimura23_ssw.html) is available on the ISCA Archive.

## Requirements

Requirements
------------
- GCC 4.8.5+ / Clang 3.5.0+ / Visual Studio 2015+
- CMake 3.1+


Installation
------------
## Installation

### Linux / macOS

<details><summary>expand</summary><div>

The latest release can be downloaded through Git.
The install procedure is as follows.

```sh
git clone https://github.com/sp-nitech/SPTK.git
cd SPTK
make
```

Then the SPTK commands can be used by adding `bin/` directory to the `PATH` environment variable.
If you would like to use a part of the SPTK functions, please link the static library `lib/libsptk.a`.

Expand All @@ -69,54 +66,56 @@ If you would like to use a part of the SPTK functions, please link the static li

You may need to add `cmake` and `MSBuild` to the `PATH` environment variable in advance.
Please run `make.bat` or open Command Prompt and follow the below procedure:

```sh
cd /path/to/SPTK # Please change here to your appropriate path.
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=.. # Please change install directory.
MSBuild /p:Configuration=Release INSTALL.vcxproj
```

You can compile SPTK via GUI instead of running MSBuild by opening the generated project file.
Then the SPTK functions can be used by linking the static library `lib/sptk.lib`.

</div></details>

## Demonstration

Demonstration
-------------
- [Twitter](https://twitter.com/SPTK_DSP)
- [Analysis-synthesis](https://colab.research.google.com/drive/1spX1v9mk6Itxa63R4wYwekzduvLeaUmE?usp=sharing) via mel-cepstrum
- [Parametric coding](https://colab.research.google.com/drive/1NeZxrWiNeixAWaux_HIBLbtaSeokUNiG?usp=sharing) via line spectral pairs

## Examples

Examples
--------
SPTK provides some examples.
Go to an example directory and execute `run.sh`, e.g.,

```sh
cd egs/analysis_synthesis/mgc
./run.sh
```

The below is a simple example that decreases the volume of input audio in `input.wav`.
You may need to install `sox` command on your system.

```sh
sox -t wav input.wav -c 1 -t s16 -r 16000 - |
x2x +sd | sopr -m 0.5 | x2x +ds -r |
sox -c 1 -t s16 -r 16000 - -t wav output.wav
```

If you would like to draw figures, please prepare a python environment.

```sh
cd tools; make venv PYTHON_VERSION=3.8; cd ..
. ./tools/venv/bin/activate
impulse -l 32 | gseries impulse.png
deactivate
```

## Changes from SPTK3

Changes from SPTK3
------------------
- **Input and output types are changed to double from float**
- Signal processing classes are written in C++ instead of C
- Drawing commands are implemented in Python
Expand Down Expand Up @@ -171,54 +170,50 @@ Changes from SPTK3
- Renamed commands:
- `mgclsp2sp` -> `mglsp2sp`

## Who we are

- **Keiichi Tokuda** - *Produce and Design* - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~tokuda/)
- **Keiichiro Oura** - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~uratec/)
- **Takenori Yoshimura** - *Main Maintainer* - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~takenori/)
- **Takato Fujimoto** - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~taka19/)

## Contributors to former versions of SPTK

- Akira Tamamori
- Cassia Valentini
- Chiyomi Miyajima
- Fernando Gil Resende Junior
- Gou Hirabayashi
- Heiga Zen
- Junichi Yamagishi
- Kazuhito Koishida
- Keiichi Tokuda
- Keiichiro Oura
- Kenji Chiba
- Masatsune Tamura
- Naohiro Isshiki
- Noboru Miyazaki
- Satoshi Imai
- Shinji Sako
- Tadashi Kitamura
- Takao Kobayashi
- Takashi Masuko
- Takashi Nose
- Takato Fujimoto
- Takayoshi Yoshimura
- Takenori Yoshimura
- Toru Takahashi
- Toshiaki Fukada
- Toshihiko Kato
- Toshio Kanno
- Yoshihiko Nankaku

## License

Who we are
----------
* **Keiichi Tokuda** - *Produce and Design* - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~tokuda/)
* **Keiichiro Oura** - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~uratec/)
* **Takenori Yoshimura** - *Main Maintainer* - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~takenori/)
* **Takato Fujimoto** - [Nagoya Institute of Technology](http://www.sp.nitech.ac.jp/~taka19/)


Contributors to former versions of SPTK
---------------------------------------
* Akira Tamamori
* Cassia Valentini
* Chiyomi Miyajima
* Fernando Gil Resende Junior
* Gou Hirabayashi
* Heiga Zen
* Junichi Yamagishi
* Kazuhito Koishida
* Keiichi Tokuda
* Keiichiro Oura
* Kenji Chiba
* Masatsune Tamura
* Naohiro Isshiki
* Noboru Miyazaki
* Satoshi Imai
* Shinji Sako
* Tadashi Kitamura
* Takao Kobayashi
* Takashi Masuko
* Takashi Nose
* Takato Fujimoto
* Takayoshi Yoshimura
* Takenori Yoshimura
* Toru Takahashi
* Toshiaki Fukada
* Toshihiko Kato
* Toshio Kanno
* Yoshihiko Nankaku


License
-------
This software is released under the Apache License 2.0.

## Citation

Citation
--------
```bibtex
@InProceedings{sp-nitech2023sptk,
author = {Takenori Yoshimura and Takato Fujimoto and Keiichiro Oura and Keiichi Tokuda},
Expand Down
2 changes: 2 additions & 0 deletions tools/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
black
breathe
clang-format
cmake-format
cpplint
flake8
isort
mdformat
sphinx
sphinx-rtd-theme

0 comments on commit 36cf677

Please sign in to comment.