# NWaves
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Version](https://img.shields.io/nuget/v/NWaves.svg?style=flat)
![NuGet](https://img.shields.io/nuget/dt/NWaves.svg?style=flat)
[![Gitter](https://badges.gitter.im/NWaves/community.svg)](https://gitter.im/NWaves/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
![logo](https://raw.githubusercontent.com/ar1st0crat/NWaves/master/assets/logo/logo_draft.bmp)
NWaves is a .NET DSP library with a lot of audio processing functions.
## Releases
NWaves is [available on NuGet](https://www.nuget.org/packages/NWaves/):
```PM> Install-Package NWaves```
[Read wiki documentation](https://github.com/ar1st0crat/NWaves/wiki)
New version **0.9.6** is out! Faster, smarter, more features. [Read about changes here](https://github.com/ar1st0crat/NWaves/wiki/Known-bugs-and-changelog)
[Notes for non-experts in DSP](https://github.com/ar1st0crat/NWaves/wiki/Notes-for-non~experts-in-DSP)
[NWaves for MATLAB/sciPy users](https://github.com/ar1st0crat/NWaves/wiki/NWaves-for-MATLAB-and-sciPy-users)
[Watch survey video](https://www.youtube.com/watch?v=GyRixqQ613A) | [Playlist](https://www.youtube.com/playlist?list=PL1BjzwHbvgSWVbr32uA2ihdnVCLhVA8a5) | [Samples](https://github.com/ar1st0crat/NWaves.Samples) | [Benchmarks](https://github.com/ar1st0crat/NWaves/tree/master/NWaves.Benchmarks) | [Playground](https://ar1st0crat.github.io/NWaves.Playground/) ([code](https://github.com/ar1st0crat/NWaves.Playground))
## Main features
- [x] major DSP transforms (FFT, DCT, MDCT, STFT, FWT, Hilbert, Hartley, Mellin, cepstral, Goertzel)
- [x] signal builders (sine, white/pink/red/Perlin noise, awgn, triangle, sawtooth, square, pulse, ramp, ADSR, wavetable)
- [x] basic LTI digital filters (moving average, comb, Savitzky-Golay, pre/de-emphasis, DC removal, RASTA)
- [x] FIR/IIR filtering (offline and online), zero-phase filtering
- [x] BiQuad filters (low-pass, high-pass, band-pass, notch, all-pass, peaking, shelving)
- [x] 1-pole filters (low-pass, high-pass)
- [x] IIR filters (Bessel, Butterworth, Chebyshev I & II, Elliptic, Thiran)
- [x] basic operations (convolution, cross-correlation, rectification, amplification, fade / crossfade)
- [x] block convolution (overlap-add / overlap-save offline and online)
- [x] basic filter design & analysis (group delay, zeros/poles, BP, BR, HP from/to LP, SOS, combining filters)
- [x] state space representation of LTI filters
- [x] FIR filter design: frequency sampling, window-sinc, equiripple (Remez / Parks-McClellan)
- [x] IIR filter design: IirNotch / IirPeak / IirCombNotch / IirCombPeak
- [x] non-linear filters (median filter, distortion effects, bit crusher)
- [x] windowing functions (Hamming, Blackman, Hann, Gaussian, Kaiser, KBD, triangular, Lanczos, flat-top, Bartlett)
- [x] periodograms (Welch / Lomb-Scargle)
- [x] psychoacoustic filter banks (Mel, Bark, Critical Bands, ERB, octaves) and VTLN warping
- [x] customizable feature extraction (time-domain, spectral, MFCC, PNCC/SPNCC, LPC, LPCC, PLP, AMS)
- [x] preconfigured MFCC extractors: HTK (MFCC-FB24), Slaney (MFCC-FB40)
- [x] LPC conversions: LPC<->cepstrum, LPC<->LSF
- [x] feature post-processing (mean and variance normalization, adding deltas) and CSV serialization
- [x] spectral features (centroid, spread, flatness, entropy, rolloff, contrast, crest, decrease, noiseness, MPEG7)
- [x] harmonic features (harmonic centroid and spread, inharmonicity, tristimulus, odd-to-even ratio)
- [x] time-domain characteristics (rms, energy, zero-crossing rate, entropy)
- [x] pitch tracking (autocorrelation, YIN, ZCR + Schmitt trigger, HSS/HPS, cepstrum)
- [x] chromagram (chroma feature extractor)
- [x] time scale modification (phase vocoder, PV with identity phase locking, WSOLA, PaulStretch)
- [x] simple resampling, interpolation, decimation
- [x] bandlimited resampling
- [x] wavelets: haar, db, symlet, coiflet
- [x] polyphase filters
- [x] noise reduction (spectral subtraction, sciPy-style Wiener filtering)
- [x] sound effects (echo, tremolo, wahwah, phaser, chorus, vibrato, flanger, pitch shift, morphing, robotize, whisperize)
- [x] 3D/Stereo audio (stereo panning, stereo and ping-pong delay, ITD-ILD, binaural panning)
- [x] envelope following
- [x] dynamics processing (limiter / compressor / expander / noise gate)
- [x] harmonic/percussive separation
- [x] Griffin-Lim algorithm
- [x] Karplus-Strong synthesis
- [x] PADSynth synthesis
- [x] adaptive filtering (LMS, NLMS, LMF, SignLMS, RLS)
- [x] simple modulation/demodulation (AM, ring, FM, PM)
- [x] simple audio playback and recording
## Philosophy of NWaves
NWaves was initially intended for research, visualizing and teaching basics of DSP and sound programming.
Usually, DSP code is quite complicated and difficult to read, because it's full of optimizations (which is actually a very good thing). NWaves project aims in particular at achieving a tradeoff between good understandable code/design and satisfactory performance. Yet, the main purpose of this lib is to offer the DSP codebase that would be:
- easy to read and understand
- easy to incorporate into existing projects
- easy to port to other programming languages and frameworks
- even possibly treated as the DSP/audio textbook.
According to NWaves architecture, there are following general reusable building blocks for all kinds of DSP tasks:
[Transforms](#transforms) | [Filters](#filters-and-effects) | [Signal builders](#signal-builders) | [Feature extractors](#feature-extractors)
## Quickstart
### Working with 1D signals
```C#
// Create signal from samples repeated 100 times
float[] samples = new [] { 0.5f, 0.2f, -0.3f, 1.2f, 1.6f, -1.8f, 0.3f, -0.2f };
var s = new DiscreteSignal(8000, samples).Repeat(100);
var length = s.Length;
var duration = s.Duration;
var echoSignal = s + s.Delay(50);
var marginSignal = s.First(64).Concatenate(s.Last(64));
var repeatMiddle = s[400, 500].Repeat(10);
var mean = s.Samples.Average();
var sigma = s.Samples.Average(x => (x - mean) * (x - mean));
var normSignal = s - mean;
normSignal.Attenuate(sigma);
```
### Signal builders
```C#
DiscreteSignal sinusoid =
new SineBuilder()
.SetParameter("frequency", 500.0/*Hz*/)
.SetParameter("phase", Math.PI / 6)
.OfLength(1000)
.SampledAt(44100/*Hz*/)
.Build();
DiscreteSignal noise =
new RedNoiseBuilder()
.SetParameter("min", -2.5)
.SetParameter("max", 2.5)
.OfLength(800)
.SampledAt(44100)
.DelayedBy(200)
.Build();
DiscreteSignal noisy =
new SineBuilder()
.SetParameter("min", -10.0)
.SetParameter("max", 10.0)
.SetParameter("freq", 1200.0/*Hz*/)
.OfLength(1000)
.SampledAt(44100)
.SuperimposedWith(noise)
.Build();
```
Signal builders can also act as real-time generators of samples:
```C#
SignalBuilder lfo =
new TriangleWaveBuilder()
.SetParameter("min", 100)
.SetParameter("max", 1500)
.SetParameter("frequency", 2.0/*Hz*/)
.SampledAt(16000/*Hz*/);
//while (...)
{
var sample = lfo.NextSample();
//...
}
```
### Signals and wave files:
```C#
WaveFile waveContainer;
// load
using (var stream = new FileStream("sample.wav", FileMode.Open))
{
waveContainer = new WaveFile(stream);
}
DiscreteSignal left = waveContainer[Channels.Left];
DiscreteSignal right = waveContainer[Channels.Right];
// save
var waveFileOut = new WaveFile(left);
using (var stream = new FileStream("saved_mono.wav", FileMode.Create))
{
waveFileOut.SaveTo(stream);
}
var waveFileStereo = new WaveFile(new [] { left, right });
using (var stream = new FileStream("saved_stereo.wav", FileMode.Create))
{
waveFileStereo.SaveTo(stream);
}
```
### Transforms
For each transform there's a corresponding transformer object.
Each transformer object has ```Direct()``` and ```I
没有合适的资源?快使用搜索试试~ 我知道了~
Laplace random number,laplace transform!
共75个文件
cache:19个
vsidx:10个
cs:7个
需积分: 0 0 下载量 63 浏览量
2023-07-31
15:12:33
上传
评论
收藏 1.33MB RAR 举报
温馨提示
laplace tranform
资源推荐
资源详情
资源评论
收起资源包目录
laplace distribution.rar (75个子文件)
laplace distribution
Form1.Designer.cs 8KB
laplace.sln 1KB
packages.config 136B
laplace.csproj 4KB
App.config 187B
Form1.cs 3KB
obj
Debug
laplace.csproj.GenerateResource.cache 126B
laplace.Form1.resources 180B
uniform.csproj.SuggestedBindingRedirects.cache 0B
exponent.csproj.SuggestedBindingRedirects.cache 0B
exponent.csproj.CoreCompileInputs.cache 42B
uniform.Properties.Resources.resources 180B
uniform.csproj.AssemblyReference.cache 7KB
laplace.csproj.CoreCompileInputs.cache 42B
exponent.csproj.CopyComplete 0B
laplace.csproj.FileListAbsolute.txt 1001B
gauss.csproj.FileListAbsolute.txt 778B
DesignTimeResolveAssemblyReferencesInput.cache 7KB
gauss.Form1.resources 180B
uniform.pdb 34KB
uniform.csproj.FileListAbsolute.txt 667B
exponent.Form1.resources 180B
laplace.csproj.AssemblyReference.cache 3KB
laplace.csproj.SuggestedBindingRedirects.cache 0B
TempPE
gauss.csproj.CoreCompileInputs.cache 42B
exponent.csproj.FileListAbsolute.txt 1021B
.NETFramework,Version=v4.8.AssemblyAttributes.cs 210B
gauss.csproj.AssemblyReference.cache 7KB
.AssemblyReference.cache 91KB
uniform.csproj.CoreCompileInputs.cache 42B
uniform.csproj.GenerateResource.cache 126B
laplace.csproj.CopyComplete 0B
gauss.csproj.SuggestedBindingRedirects.cache 0B
gauss.csproj.GenerateResource.cache 126B
exponent.csproj.GenerateResource.cache 126B
exponent.csproj.AssemblyReference.cache 8KB
DesignTimeResolveAssemblyReferences.cache 3KB
uniform.exe 13KB
.vs
uniform
FileContentIndex
e505e537-cd99-49d5-a93a-edec425ddf49.vsidx 9KB
read.lock 0B
fd383455-e97d-4726-9f78-a01cf4c3853a.vsidx 22KB
6b579ba1-c703-487b-ad93-1332630c9429.vsidx 42KB
dcb1b1aa-f696-410b-95c7-6109d5fb6d99.vsidx 1KB
merges
exponent
FileContentIndex
read.lock 0B
dc40fdb2-48a6-46a4-8387-bde5d244768f.vsidx 48KB
47d9655f-1f7f-488e-9e13-c71d4a4a7e18.vsidx 1KB
76a236ee-4a16-4400-96bf-22180dbe1161.vsidx 47KB
merges
gauss
FileContentIndex
read.lock 0B
10e4e1a9-30ce-4926-b4e7-d30edec9c442.vsidx 50KB
ba870871-5bb0-4643-80f4-288ce655990c.vsidx 48KB
merges
laplace
v17
.suo 68KB
FileContentIndex
e93e28e4-650f-4d75-8cf4-ef5900caacf5.vsidx 48KB
read.lock 0B
merges
bin
Release
Debug
uniform.pdb 34KB
uniform.exe.config 187B
NWaves.xml 688KB
NWaves.dll 343KB
uniform.exe 13KB
Properties
Resources.Designer.cs 3KB
Settings.Designer.cs 1KB
Settings.settings 249B
AssemblyInfo.cs 1KB
Resources.resx 5KB
Program.cs 539B
Form1.resx 6KB
packages
HG.NWaves.0.9.6
lib
net472
NWaves.xml 688KB
NWaves.dll 343KB
netstandard2.0
NWaves.xml 688KB
NWaves.dll 343KB
net6.0
NWaves.xml 688KB
NWaves.dll 343KB
HG.NWaves.0.9.6.nupkg 627KB
logo.png 9KB
README.md 20KB
.signature.p7s 11KB
共 75 条
- 1
资源评论
悠风长啸
- 粉丝: 1
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功