├── .gitignore ├── LICENSE ├── README.md ├── audio_utils.py ├── create_mulchwave.py ├── dataset.py ├── generic.py ├── hparams.py ├── main.py ├── matlab_lib ├── LICENSE ├── README.md ├── __init__.py ├── eval.py ├── se_eval.m └── sub_lib │ ├── MATLAB_code │ ├── ideal_channel_selection │ │ ├── S_01_01-noisy.wav │ │ ├── S_01_01.wav │ │ ├── S_01_02-babble_m10dB.wav │ │ ├── S_01_02-noisy.wav │ │ ├── S_01_02.wav │ │ ├── S_01_10-noisy.wav │ │ ├── S_01_10.wav │ │ ├── S_02_01.wav │ │ ├── S_02_02-babble_m5dB.wav │ │ ├── S_02_02.wav │ │ ├── babble1.wav │ │ ├── clean_2.wav │ │ ├── ics.m │ │ ├── ics_competing_talker.m │ │ ├── ics_constr_rule.m │ │ ├── ics_masker_rule.m │ │ ├── ics_reverb.m │ │ ├── initialise_parameters.m │ │ ├── mcra2_estimation.m │ │ ├── noise_estimation.m │ │ ├── readme.pdf │ │ ├── readme.txt │ │ ├── rev800_2.wav │ │ └── talker_mixture.wav │ ├── noise_estimation │ │ ├── connfreq_estimation.m │ │ ├── doblinger_estimation.m │ │ ├── hirsch_estimation.m │ │ ├── imcra_estimation.m │ │ ├── initialise_parameters.m │ │ ├── martin_estimation.m │ │ ├── mcra2_estimation.m │ │ ├── mcra_estimation.m │ │ ├── noise_estimation.m │ │ ├── readme.pdf │ │ ├── readme.txt │ │ ├── sp02_train_sn5.wav │ │ ├── sp04_babble_sn10.wav │ │ └── specsub_ns.m │ ├── objective_measures │ │ ├── intelligibility │ │ │ ├── CSII.m │ │ │ ├── NCM.m │ │ │ ├── SII.m │ │ │ ├── S_03_01.wav │ │ │ ├── S_03_01_babble_sn0_klt.wav │ │ │ └── readme.txt │ │ └── quality │ │ │ ├── addnoise_asl.m │ │ │ ├── comp_cep.m │ │ │ ├── comp_fwseg.m │ │ │ ├── comp_fwseg_mars.m │ │ │ ├── comp_fwseg_variant.m │ │ │ ├── comp_is.m │ │ │ ├── comp_llr.m │ │ │ ├── comp_snr.m │ │ │ ├── comp_wss.m │ │ │ ├── composite.m │ │ │ ├── enhanced.wav │ │ │ ├── fwseg.m │ │ │ ├── fwsegsnr.m │ │ │ ├── pesq.m │ │ │ ├── readme.pdf │ │ │ ├── readme.txt │ │ │ ├── sp04.wav │ │ │ ├── sp04_babble_sn10.wav │ │ │ └── white_noise.wav │ ├── spectral_subtractive │ │ ├── mband.m │ │ ├── readme.pdf │ │ ├── readme.txt │ │ ├── sp02_train_sn5.wav │ │ ├── sp04_babble_sn10.wav │ │ ├── specsub.m │ │ └── ss_rdc.m │ ├── statistical_based │ │ ├── audnoise.m │ │ ├── confhyperg.m │ │ ├── hyperg.m │ │ ├── logmmse.m │ │ ├── logmmse_SPU.m │ │ ├── mask.m │ │ ├── mmse.m │ │ ├── mt_mask.m │ │ ├── readme.pdf │ │ ├── readme.txt │ │ ├── sp02_train_sn5.wav │ │ ├── sp04_babble_sn10.wav │ │ ├── sp06_babble_sn5.wav │ │ ├── sp09_babble_sn10.wav │ │ ├── stsa_mis.m │ │ ├── stsa_wcosh.m │ │ ├── stsa_weuclid.m │ │ ├── stsa_wlr.m │ │ ├── wiener_as.m │ │ ├── wiener_iter.m │ │ └── wiener_wt.m │ └── subspace │ │ ├── klt.asv │ │ ├── klt.m │ │ ├── mask.m │ │ ├── pklt.m │ │ ├── readme.pdf │ │ ├── readme.txt │ │ └── sp04_babble_sn10.wav │ ├── SoundZone_Tools-master │ └── SoundZone_Tools-master │ │ ├── .gitignore │ │ ├── ALcons2STI.m │ │ ├── ArbitraryOctaveFilt.m │ │ ├── COSHdist.m │ │ ├── ConcatTIMITtalkers.m │ │ ├── Correlated_Normalisation.m │ │ ├── Dropbox.m │ │ ├── IRcompactingKirkebyFilter.m │ │ ├── LICENSE │ │ ├── LTASS.m │ │ ├── MiKTeX_FNDB_Refresh.m │ │ ├── README.md │ │ ├── STI.m │ │ ├── STI_BandFilters.m │ │ ├── addNoise.m │ │ ├── buildDocumentation.m │ │ ├── buildReleaseZIP.m │ │ ├── composite │ │ ├── DC_block.p │ │ ├── FFTNXCorr.p │ │ ├── apply_VAD.p │ │ ├── apply_filter.p │ │ ├── apply_filters.p │ │ ├── batch_pesq.p │ │ ├── batch_pesq2.p │ │ ├── composite.asv │ │ ├── composite.m │ │ ├── convolution_in_timealign.p │ │ ├── crude_align.p │ │ ├── enhanced_logmmse.wav │ │ ├── fix_power_level.p │ │ ├── id_searchwindows.p │ │ ├── id_utterances.p │ │ ├── input_filter.p │ │ ├── pesq.p │ │ ├── pesq_debug.p │ │ ├── pesq_measure.p │ │ ├── pesq_psychoacoustic_model.p │ │ ├── pesq_testbench.p │ │ ├── plot_wav.p │ │ ├── pow_of.p │ │ ├── readme.pdf │ │ ├── readme.txt │ │ ├── setup_global.p │ │ ├── sp09.wav │ │ ├── sp09_babble_sn10.wav │ │ ├── split_align.p │ │ ├── time_align.p │ │ ├── utterance_locate.p │ │ └── utterance_split.p │ │ ├── confidence_intervals.m │ │ ├── estoi.m │ │ ├── extractIR.m │ │ ├── fconv.m │ │ ├── fdeconv.m │ │ ├── generateNoise.m │ │ ├── getAllFiles.m │ │ ├── interpFromVal_2D.m │ │ ├── interpVal.m │ │ ├── interpVal_2D.m │ │ ├── invFIR.m │ │ ├── invSweepFFT.m │ │ ├── invimplms.m │ │ ├── invsweepfft.mat │ │ ├── keepFilesFromFolder.m │ │ ├── octaveBandMean.m │ │ ├── pesq.exe │ │ ├── pesq2.m │ │ ├── pesq3.m │ │ ├── pesq_NoResFile.exe │ │ ├── pesq_mex.mexa64 │ │ ├── pesq_mex.mexw64 │ │ ├── pesq_mex_fast.mexw64 │ │ ├── pesq_mex_fast_vec.m │ │ ├── pesq_mex_vec.m │ │ ├── pesq_results.txt │ │ ├── printHyperlink.m │ │ ├── repmatmatch.m │ │ ├── shapeSpectrum.m │ │ ├── showTimeToCompletion.m │ │ ├── simpleWarning.m │ │ ├── sineSweepLin.m │ │ ├── stoi.m │ │ ├── stoi_d2percCorr.m │ │ ├── synthSweep.m │ │ ├── toepsolveMEX.mexw64 │ │ └── wait_for_file.m │ ├── WienerNoiseReduction.m │ ├── WienerScalart96.m │ ├── dirPlus │ ├── dirPlus.m │ ├── dirPlus_demo.m │ ├── html │ │ └── dirPlus_demo.html │ └── license.txt │ ├── lsd │ └── LogSpectralDistance.m │ ├── noise_add.m │ ├── pesq_results.txt │ ├── sample.wav │ ├── segsnr │ ├── addnoise.m │ ├── pesq_results.txt │ ├── segsnr.m │ ├── segsnr.png │ ├── snr_mean.m │ ├── sp10.wav │ ├── ssn.wav │ └── vec2frames.m │ ├── taal2011.m │ ├── untitled3.m │ └── voicebox │ ├── Contents.m │ ├── activlev.m │ ├── activlevg.m │ ├── atan2sc.m │ ├── axisenlarge.m │ ├── bark2frq.m │ ├── berk2prob.m │ ├── besselratio.m │ ├── besselratioi.m │ ├── bitsprec.m │ ├── cblabel.m │ ├── ccwarpf.m │ ├── cent2frq.m │ ├── cep2pow.m │ ├── choosenk.m │ ├── choosrnk.m │ ├── convfft.m │ ├── correlogram.m │ ├── distchar.m │ ├── distchpf.m │ ├── disteusq.m │ ├── distisar.m │ ├── distispf.m │ ├── distitar.m │ ├── distitpf.m │ ├── ditherq.m │ ├── dlyapsq.m │ ├── dualdiag.m │ ├── dypsa.m │ ├── enframe.m │ ├── entropy.m │ ├── erb2frq.m │ ├── estnoiseg.m │ ├── estnoisem.m │ ├── ewgrpdel.m │ ├── fig2emf.m │ ├── figbolden.m │ ├── filtbankm.m │ ├── filterbank.m │ ├── finishat.m │ ├── flac.exe │ ├── fopenmkd.m │ ├── frac2bin.m │ ├── fram2wav.m │ ├── frq2bark.m │ ├── frq2cent.m │ ├── frq2erb.m │ ├── frq2mel.m │ ├── frq2midi.m │ ├── fxpefac.m │ ├── fxrapt.m │ ├── gammabank.m │ ├── gammalns.m │ ├── gausprod.m │ ├── gaussmix.m │ ├── gaussmixd.m │ ├── gaussmixg.m │ ├── gaussmixk.m │ ├── gaussmixm.m │ ├── gaussmixp.m │ ├── gaussmixt.m │ ├── glotlf.m │ ├── glotros.m │ ├── gmmlpdf.m │ ├── histndim.m │ ├── hostipinfo.m │ ├── huffman.m │ ├── hypergeom1f1.m │ ├── imagehomog.m │ ├── importsii.m │ ├── irdct.m │ ├── irfft.m │ ├── kmeanhar.m │ ├── kmeanlbg.m │ ├── lambda2rgb.m │ ├── ldatrace.m │ ├── lin2pcma.m │ ├── lin2pcmu.m │ ├── lognmpdf.m │ ├── logsum.m │ ├── lpcaa2ao.m │ ├── lpcaa2dl.m │ ├── lpcaa2rf.m │ ├── lpcao2rf.m │ ├── lpcar2am.m │ ├── lpcar2cc.m │ ├── lpcar2db.m │ ├── lpcar2ff.m │ ├── lpcar2fm.m │ ├── lpcar2im.m │ ├── lpcar2ls.m │ ├── lpcar2pf.m │ ├── lpcar2pp.m │ ├── lpcar2ra.m │ ├── lpcar2rf.m │ ├── lpcar2rr.m │ ├── lpcar2zz.m │ ├── lpcauto.m │ ├── lpcbwexp.m │ ├── lpccc2ar.m │ ├── lpccc2cc.m │ ├── lpccc2db.m │ ├── lpccc2ff.m │ ├── lpccc2pf.m │ ├── lpcconv.m │ ├── lpccovar.m │ ├── lpccw2zz.m │ ├── lpcdb2pf.m │ ├── lpcdl2aa.m │ ├── lpcff2pf.m │ ├── lpcfq2zz.m │ ├── lpcifilt.m │ ├── lpcim2ar.m │ ├── lpcis2rf.m │ ├── lpcla2rf.m │ ├── lpclo2rf.m │ ├── lpcls2ar.m │ ├── lpcpf2cc.m │ ├── lpcpf2ff.m │ ├── lpcpf2rr.m │ ├── lpcpp2cw.m │ ├── lpcpp2pz.m │ ├── lpcpz2zz.m │ ├── lpcra2ar.m │ ├── lpcra2pf.m │ ├── lpcra2pp.m │ ├── lpcrand.m │ ├── lpcrf2aa.m │ ├── lpcrf2ao.m │ ├── lpcrf2ar.m │ ├── lpcrf2is.m │ ├── lpcrf2la.m │ ├── lpcrf2lo.m │ ├── lpcrf2rr.m │ ├── lpcrr2am.m │ ├── lpcrr2ar.m │ ├── lpcss2zz.m │ ├── lpcstable.m │ ├── lpczz2ar.m │ ├── lpczz2cc.m │ ├── lpczz2ss.m │ ├── m2htmlpwd.m │ ├── maxfilt.m │ ├── maxgauss.m │ ├── meansqtf.m │ ├── mel2frq.m │ ├── melbankm.m │ ├── melcepst.m │ ├── midi2frq.m │ ├── minspane.m │ ├── mintrace.m │ ├── modspect.m │ ├── momfilt.m │ ├── mos2pesq.m │ ├── nearnonz.m │ ├── normcdflog.m │ ├── overlapadd.m │ ├── paramsetch.m │ ├── pcma2lin.m │ ├── pcmu2lin.m │ ├── pdfmoments.m │ ├── peak2dquad.m │ ├── permutes.m │ ├── pesq2mos.m │ ├── phon2sone.m │ ├── polygonarea.m │ ├── polygonwind.m │ ├── polygonxline.m │ ├── potsband.m │ ├── pow2cep.m │ ├── prob2berk.m │ ├── psycdigit.m │ ├── psycest.m │ ├── psycestu.m │ ├── psychofunc.m │ ├── qrabs.m │ ├── qrdivide.m │ ├── qrdotdiv.m │ ├── qrdotmult.m │ ├── qrmult.m │ ├── qrpermute.m │ ├── quadpeak.m │ ├── randfilt.m │ ├── randiscr.m │ ├── randvec.m │ ├── rdct.m │ ├── readaif.m │ ├── readau.m │ ├── readcnx.m │ ├── readflac.m │ ├── readhtk.m │ ├── readsfs.m │ ├── readsph.m │ ├── readwav.m │ ├── rectifyhomog.m │ ├── regexfiles.m │ ├── rfft.m │ ├── rhartley.m │ ├── rnsubset.m │ ├── rotation.m │ ├── rotax2qr.m │ ├── roteu2qr.m │ ├── roteu2ro.m │ ├── rotmc2qc.m │ ├── rotmr2qr.m │ ├── rotpl2ro.m │ ├── rotqc2mc.m │ ├── rotqc2qr.m │ ├── rotqr2ax.m │ ├── rotqr2eu.m │ ├── rotqr2mr.m │ ├── rotqr2qc.m │ ├── rotqr2ro.m │ ├── rotqrmean.m │ ├── rotqrvec.m │ ├── rotro2eu.m │ ├── rotro2pl.m │ ├── rotro2qr.m │ ├── rsfft.m │ ├── sapisynth.m │ ├── schmitt.m │ ├── shorten.exe │ ├── sigalign.m │ ├── skew3d.m │ ├── snrseg.m │ ├── sone2phon.m │ ├── soundspeed.m │ ├── specsub.m │ ├── specsubm.m │ ├── spendred.m │ ├── spgrambw.m │ ├── sphrharm.m │ ├── sprintcpx.m │ ├── sprintsi.m │ ├── ssubmmse.m │ ├── ssubmmsev.m │ ├── stdspectrum.m │ ├── stoi2prob.m │ ├── teager.m │ ├── texthvc.m │ ├── tilefigs.m │ ├── txalign.m │ ├── unixwhich.m │ ├── upolyhedron.m │ ├── usasi.m │ ├── v_addnoise.m │ ├── v_chimv.m │ ├── v_colormap.m │ ├── v_findpeaks.m │ ├── v_kmeans.m │ ├── v_ppmvu.m │ ├── v_resample.m │ ├── v_sigma.m │ ├── v_windinfo.m │ ├── v_windows.m │ ├── vadsohn.m │ ├── voicebox.m │ ├── vonmisespdf.m │ ├── wavread.m │ ├── wavwrite.m │ ├── winenvar.m │ ├── writehtk.m │ ├── writewav.m │ ├── xticksi.m │ ├── xyzticksi.m │ ├── yticksi.m │ ├── zerocros.m │ ├── zerotrim.m │ └── zoomfft.m ├── model ├── __init__.py └── dwavenet.py ├── tbXwriter.py ├── train.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | 3 | 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib/ 21 | lib64/ 22 | parts/ 23 | sdist/ 24 | var/ 25 | wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | MANIFEST 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # pyenv 79 | .python-version 80 | 81 | # celery beat schedule file 82 | celerybeat-schedule 83 | 84 | # SageMath parsed files 85 | *.sage.py 86 | 87 | # Environments 88 | .env 89 | .venv 90 | env/ 91 | venv/ 92 | ENV/ 93 | env.bak/ 94 | venv.bak/ 95 | 96 | # Spyder project settings 97 | .spyderproject 98 | .spyproject 99 | 100 | # Rope project settings 101 | .ropeproject 102 | 103 | # mkdocs documentation 104 | /site 105 | 106 | # mypy 107 | .mypy_cache/ 108 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jeongmin Liu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /matlab_lib/README.md: -------------------------------------------------------------------------------- 1 | # Library for Speech Processing Evaluation written in MATLAB 2 | 3 | forked from [jtkim-kaist/Speech-enhancement](https://github.com/jtkim-kaist/Speech-enhancement/tree/master/SE/lib). 4 | 5 | -------------------------------------------------------------------------------- /matlab_lib/__init__.py: -------------------------------------------------------------------------------- 1 | from .eval import Evaluation 2 | -------------------------------------------------------------------------------- /matlab_lib/se_eval.m: -------------------------------------------------------------------------------- 1 | function [fwsnr, pesq, stoi_val] = se_eval(clean, noisy, fs) 2 | 3 | %[clean, clean_fs] = audioread(clean_name); 4 | %[noisy, ~] = audioread(enhanced_name); 5 | 6 | fwsnr = fwsegsnr(clean, noisy, fs); 7 | 8 | res = pesq_mex_vec(clean, noisy, fs); 9 | pesq=mos2pesq(res); 10 | 11 | 12 | stoi_val = stoi(double(clean), double(noisy), fs); 13 | 14 | % clean = clean/max(abs(clean)); 15 | % noisy = noisy/max(abs(noisy)); 16 | 17 | % size(clean') 18 | % size(noisy') 19 | % snr = segsnr(clean', noisy', fs); 20 | % plot(noisy - clean); 21 | clc 22 | end 23 | 24 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_01-noisy.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_01-noisy.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_01.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_02-babble_m10dB.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_02-babble_m10dB.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_02-noisy.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_02-noisy.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_02.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_02.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_10-noisy.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_10-noisy.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_01_10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_02_01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_02_01.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_02_02-babble_m5dB.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_02_02-babble_m5dB.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_02_02.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/S_02_02.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/babble1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/babble1.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/clean_2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/clean_2.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/mcra2_estimation.m: -------------------------------------------------------------------------------- 1 | function parameters = newmethod_estimation(ns_ps,parameters) 2 | 3 | % parameters = struct('n',2,'len',len_val,'ad',0.95,'as',0.8,'ap',0.2,'beta',0.8,'beta1',0.98,'gamma',0.998,'alpha',0.7,... 4 | % 'pk',zeros(len_val,1),'noise_ps',ns_ps,'pxk_old',ns_ps,'pxk',ns_ps,'pnk_old',ns_ps,'pnk',ns_ps); 5 | 6 | n = parameters.n; 7 | len = parameters.len; 8 | ad = parameters.ad; 9 | as = parameters.as; 10 | ap = parameters.ap; 11 | beta = parameters.beta; 12 | gamma = parameters.gamma; 13 | alpha = parameters.alpha; 14 | pk = parameters.pk; 15 | delta = parameters.delta; 16 | 17 | noise_ps = parameters.noise_ps; 18 | pxk = parameters.pxk; 19 | pnk = parameters.pnk; 20 | pxk_old = parameters.pxk_old; 21 | pnk_old = parameters.pnk_old; 22 | 23 | pxk=alpha*pxk_old+(1-alpha)*(ns_ps); 24 | pnk=pxk; 25 | index=find(pnk_old delta); 36 | Ikl(ikl_indx)=1; 37 | pk = ap*pk+(1-ap)*Ikl; % Eq. 14 38 | adk = ad+(1-ad)*pk; % Eq. 5 39 | noise_ps=adk.*noise_ps + (1-adk).*pxk; % Eq. 4 40 | 41 | parameters.n = n+1; 42 | parameters.pk = pk; 43 | parameters.noise_ps = noise_ps; 44 | parameters.pnk = pnk; 45 | parameters.pnk_old = pnk_old; 46 | parameters.pxk = pxk; 47 | parameters.pxk_old = pxk_old; 48 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/noise_estimation.m: -------------------------------------------------------------------------------- 1 | function parameters = noise_estimation(noisy_ps,method,parameters) 2 | switch lower(method) 3 | case 'martin' 4 | parameters = martin_estimation(noisy_ps,parameters); 5 | case 'mcra' 6 | parameters = mcra_estimation(noisy_ps,parameters); 7 | case 'imcra' 8 | parameters = imcra_estimation(noisy_ps,parameters); 9 | case 'doblinger' 10 | parameters = doblinger_estimation(noisy_ps,parameters); 11 | case 'hirsch' 12 | parameters = hirsch_estimation(noisy_ps,parameters); 13 | case 'mcra2' 14 | parameters = mcra2_estimation(noisy_ps,parameters); 15 | case 'conn_freq' 16 | parameters = connfreq_estimation(noisy_ps,parameters); 17 | end 18 | return; -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/readme.pdf -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/readme.txt -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/rev800_2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/rev800_2.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/talker_mixture.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/ideal_channel_selection/talker_mixture.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/doblinger_estimation.m: -------------------------------------------------------------------------------- 1 | function [parameters] = doblinger_estimation(ns_ps,parameters) 2 | 3 | % parameters = struct('n',2,'len',len_val,'alpha',0.7,'beta',0.96,'gamma',0.998,'noise_ps',ns_ps,'pxk_old',ns_ps,... 4 | % 'pxk',ns_ps,'pnk_old',ns_ps,'pnk',ns_ps); 5 | 6 | n = parameters.n; 7 | len = parameters.len; 8 | alpha = parameters.alpha; 9 | beta = parameters.beta; 10 | gamma = parameters.gamma; 11 | noise_ps = parameters.noise_ps; 12 | 13 | pxk_old = parameters.pxk_old; 14 | pxk = parameters.pxk; 15 | pnk_old = parameters.pnk_old; 16 | pnk = parameters.pnk; 17 | 18 | pxk=alpha*pxk_old+(1-alpha)*ns_ps; 19 | for t=1:len 20 | if pnk_old(t)<=pxk(t) 21 | pnk(t)=(gamma.*pnk_old(t))+(((1-gamma)/(1-beta)).*(pxk(t)-beta.*pxk_old(t))); 22 | else 23 | pnk(t)=pxk(t); 24 | end 25 | end 26 | pxk_old=pxk; 27 | pnk_old=pnk; 28 | noise_ps = pnk; 29 | 30 | parameters.n = n+1; 31 | parameters.noise_ps = noise_ps; 32 | parameters.pnk = pnk; 33 | parameters.pnk_old = pnk_old; 34 | parameters.pxk = pxk; 35 | parameters.pxk_old = pxk_old; 36 | 37 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/hirsch_estimation.m: -------------------------------------------------------------------------------- 1 | function parameters = hirsch_estimation(ns_ps,parameters) 2 | 3 | % parameters = struct('n',2,'len',len_val,'as',0.85,'as1',0.7,'beta',1.5,'omin',1.5,'noise_ps',ns_ps,'P',ns_ps); 4 | 5 | n = parameters.n; 6 | len = parameters.len; 7 | as = parameters.as; 8 | beta = parameters.beta; 9 | omin = parameters.omin; 10 | 11 | noise_ps = parameters.noise_ps; 12 | P = parameters.P; 13 | 14 | P=as*P+(1-as)*ns_ps; 15 | index=find(P delta); 36 | Ikl(ikl_indx)=1; 37 | pk = ap*pk+(1-ap)*Ikl; % Eq. 14 38 | adk = ad+(1-ad)*pk; % Eq. 5 39 | noise_ps=adk.*noise_ps + (1-adk).*pxk; % Eq. 4 40 | 41 | parameters.n = n+1; 42 | parameters.pk = pk; 43 | parameters.noise_ps = noise_ps; 44 | parameters.pnk = pnk; 45 | parameters.pnk_old = pnk_old; 46 | parameters.pxk = pxk; 47 | parameters.pxk_old = pxk_old; 48 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/mcra_estimation.m: -------------------------------------------------------------------------------- 1 | function parameters = cohenMCRA_estimation(ns_ps,parameters); 2 | 3 | as = parameters.as; 4 | ad = parameters.ad; 5 | ap = parameters.ap; 6 | pk = parameters.pk; 7 | delta = parameters.delta; 8 | L = parameters.L; 9 | n = parameters.n; 10 | len = parameters.len; 11 | noise_ps = parameters.noise_ps; 12 | P = parameters.P; 13 | Pmin = parameters.Pmin; 14 | Ptmp = parameters.Ptmp; 15 | 16 | P=as*P+(1-as)*ns_ps; % Eq. 7 17 | 18 | if rem(n,L)==0 19 | Pmin=min(Ptmp,P); % Eq. 10 20 | Ptmp=P; % Eq. 11 21 | else 22 | Pmin=min(Pmin,P); % Eq. 8 23 | Ptmp=min(Ptmp,P); % Eq. 9 24 | end 25 | 26 | Srk=P./Pmin; 27 | 28 | Ikl=zeros(len,1); 29 | ikl_indx=find(Srk > delta); 30 | Ikl(ikl_indx)=1; 31 | pk = ap*pk+(1-ap)*Ikl; % Eq. 14 32 | adk = ad+(1-ad)*pk; % Eq. 5 33 | noise_ps=adk.*noise_ps + (1-adk).*ns_ps; % Eq. 4 34 | 35 | parameters.pk = pk; 36 | parameters.n = n+1; 37 | parameters.noise_ps = noise_ps; 38 | parameters.P = P; 39 | parameters.Pmin = Pmin; 40 | parameters.Ptmp = Ptmp; -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/noise_estimation.m: -------------------------------------------------------------------------------- 1 | function parameters = noise_estimation(noisy_ps,method,parameters) 2 | switch lower(method) 3 | case 'martin' 4 | parameters = martin_estimation(noisy_ps,parameters); 5 | case 'mcra' 6 | parameters = mcra_estimation(noisy_ps,parameters); 7 | case 'imcra' 8 | parameters = imcra_estimation(noisy_ps,parameters); 9 | case 'doblinger' 10 | parameters = doblinger_estimation(noisy_ps,parameters); 11 | case 'hirsch' 12 | parameters = hirsch_estimation(noisy_ps,parameters); 13 | case 'mcra2' 14 | parameters = mcra2_estimation(noisy_ps,parameters); 15 | case 'conn_freq' 16 | parameters = connfreq_estimation(noisy_ps,parameters); 17 | end 18 | return; -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/noise_estimation/readme.pdf -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/noise_estimation/readme.txt -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/sp02_train_sn5.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/noise_estimation/sp02_train_sn5.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/noise_estimation/sp04_babble_sn10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/noise_estimation/sp04_babble_sn10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/NCM.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/NCM.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/S_03_01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/S_03_01.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/S_03_01_babble_sn0_klt.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/S_03_01_babble_sn0_klt.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/intelligibility/readme.txt: -------------------------------------------------------------------------------- 1 | Usage: 2 | NCM (cleanFileName.wav,NoisySpeechFilename.wav') 3 | 4 | Example: 5 | >> NCM('S_03_01.wav','S_03_01_babble_sn0_klt.wav') 6 | 7 | ans = 8 | 9 | 0.4162 10 | 11 | Reference: 12 | [1] Ma, J., Hu, Y. and Loizou, P. (2009). "Objective measures for 13 | predicting speech intelligibility in noisy conditions based on new band-importance 14 | functions", Journal of the Acoustical Society of America, 125(5), 3387-3405. 15 | 16 | ================================================= 17 | CSII measure usage: 18 | >> [CSh, CSm, CSl]=CSII('S_03_01.wav', 'S_03_01_babble_sn0_klt.wav') 19 | 20 | CSh = 21 | 22 | 0.5556 23 | 24 | 25 | CSm = 26 | 27 | 0.2480 28 | 29 | 30 | CSl = 31 | 32 | 0.0457 33 | 34 | ============================================================= 35 | SII Measure usage: 36 | 37 | sp=[40 45 50 24 56 60 55 55 52 48 50 51 55 67 76 67 56 31]; % values in dB SPL 38 | ns=[30 50 60 20 60 50 70 45 80 40 60 20 60 22 55 50 67 40]; % values in dB SPL 39 | M= 5; 40 | sv = SII (sp,ns, M) 41 | 42 | sv = 43 | 44 | 0.2357 -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/comp_fwseg.m: -------------------------------------------------------------------------------- 1 | function fwseg_dist= comp_fwseg(cleanFile, enhancedFile); 2 | 3 | % ---------------------------------------------------------------------- 4 | % Frequency weighted SNRseg Objective Speech Quality Measure 5 | % 6 | % This function implements the frequency-weighted SNRseg measure [1] 7 | % using a different weighting function, the clean spectrum. 8 | % 9 | % Usage: fwSNRseg=comp_fwseg(cleanFile.wav, enhancedFile.wav) 10 | % 11 | % cleanFile.wav - clean input file in .wav format 12 | % enhancedFile - enhanced output file in .wav format 13 | % fwSNRseg - computed frequency weighted SNRseg in dB 14 | % 15 | % Note that large numbers of fwSNRseg are better. 16 | % 17 | % Example call: fwSNRseg =comp_fwseg('sp04.wav','enhanced.wav') 18 | % 19 | % 20 | % References: 21 | % [1] Tribolet, J., Noll, P., McDermott, B., and Crochiere, R. E. (1978). 22 | % A study of complexity and quality of speech waveform coders. Proc. 23 | % IEEE Int. Conf. Acoust. , Speech, Signal Processing, 586-590. 24 | % 25 | % Author: Philipos C. Loizou 26 | % (critical-band filtering routines were written by Bryan Pellom & John Hansen) 27 | % 28 | % Copyright (c) 2006 by Philipos C. Loizou 29 | % $Revision: 0.0 $ $Date: 10/09/2006 $ 30 | % ---------------------------------------------------------------------- 31 | 32 | if nargin~=2 33 | fprintf('USAGE: fwSNRseg=comp_fwseg(cleanFile.wav, enhancedFile.wav)\n'); 34 | fprintf('For more help, type: help comp_fwseg\n\n'); 35 | return; 36 | end 37 | 38 | 39 | [data1, Srate1, Nbits1]= wavread(cleanFile); 40 | [data2, Srate2, Nbits2]= wavread(enhancedFile); 41 | if ( Srate1~= Srate2) | ( Nbits1~= Nbits2) 42 | error( 'The two files do not match!\n'); 43 | end 44 | 45 | len= min( length( data1), length( data2)); 46 | data1= data1( 1: len)+eps; 47 | data2= data2( 1: len)+eps; 48 | 49 | wss_dist_vec= fwseg( data1, data2,Srate1); 50 | 51 | fwseg_dist=mean(wss_dist_vec); 52 | 53 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/enhanced.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/enhanced.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/fwsegsnr.m: -------------------------------------------------------------------------------- 1 | function snr = fwsegsnr(clean_speech, processed_speech, fs) 2 | [len, ~] = size(clean_speech); 3 | if len==1 4 | clean_speech = clean_speech.'; 5 | processed_speech = processed_speech.'; 6 | end 7 | snr = mean(fwseg(clean_speech, processed_speech, fs)); 8 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/readme.pdf -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/sp04.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/sp04.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/sp04_babble_sn10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/sp04_babble_sn10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/white_noise.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/objective_measures/quality/white_noise.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/readme.pdf -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/readme.txt: -------------------------------------------------------------------------------- 1 | This folder contains spectral subtractive algorithms (Chapter 5): 2 | 3 | Reference 4 | specsub.m Basic spectral subtraction algorithm [4] 5 | mband.m Multi-band spectral subtraction. [9] 6 | ss_rdc.m Spectral subtraction with adaptive 7 | gain averaging and reduced delay 8 | convolution [10] 9 | -------------------------------------------------------------------------- 10 | USAGE 11 | >> specsub(infile.wav,outfile.wav) 12 | 13 | >> mband(infile.wav,outfile.wav,Number_Of_Channels,Freq_Spacing) 14 | where 15 | 'Number_of_Channels' is the number of bands 16 | 'Freq_spacing' is: 'linear', 'log', 'mel' 17 | 18 | Example usage: 19 | mband('sp04_babble_sn10.wav','outmb.wav',6,'linear'); 20 | 21 | >> ss_rdc(infile.wav, outfile.wav) 22 | 23 | -------------------------------------------------------------------------- 24 | References: 25 | 26 | [4] Berouti, M., Schwartz, M., and Makhoul, J. (1979). Enhancement of speech 27 | corrupted by acoustic noise. Proc. IEEE Int. Conf. Acoust., Speech, 28 | Signal Processing, 208-211. 29 | [9] Kamath, S. and Loizou, P. (2002). A multi-band spectral subtraction 30 | method for enhancing speech corrupted by colored noise. Proc. IEEE Int. 31 | Conf. Acoust.,Speech, Signal Processing 32 | [10] Gustafsson, H., Nordholm, S., and Claesson, I. (2001). Spectral sub- 33 | traction using reduced delay convolution and adaptive averaging. IEEE 34 | Trans. on Speech and Audio Processing, 9(8), 799-807. 35 | 36 | Copyright (c) 2006 by Philipos C. Loizou 37 | $Revision: 0.0 $ $Date: 07/30/2006 $ 38 | ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/sp02_train_sn5.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/sp02_train_sn5.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/sp04_babble_sn10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/spectral_subtractive/sp04_babble_sn10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/statistical_based/confhyperg.m: -------------------------------------------------------------------------------- 1 | function z=confhyperg(a,b,x,n) 2 | % 3 | % Computes the confluent hypergeometric function 4 | % using a series expansion: 5 | % 6 | % f(a,b;x)= 7 | % 8 | % 1 + [ab/1!c]x + [a(a+1)/2!b(b+1)]x^2 + 9 | % [a(a+1)(a+2)/3!b(b+1)(b+2)]x^3 + ... 10 | % 11 | % The above series is expanded to n terms 12 | % 13 | % 14 | % 15 | % Philipos C. Loizou 16 | 17 | if nargin ~= 4 18 | error('Usage: confhyperg(a,b,x,n) - Incorrect number of arguments') 19 | end 20 | 21 | if (n <= 0 | n ~= floor(n)) 22 | error('Usage: confhyperg (a,b,c,x,n) - n has to be a positive integer') 23 | end 24 | 25 | NEG=0; 26 | if x<0 27 | x=abs(x); 28 | a=b-a; 29 | NEG=1; 30 | end 31 | 32 | z = 0; 33 | m = 0; 34 | while (m Wrong number of arguments') 28 | end 29 | 30 | if (n <= 0 | n ~= floor(n)) 31 | error('Usage: hypergeometric2f1(a,b,c,x,n) --> n has to be a positive integer') 32 | end 33 | 34 | % if (abs(x) > 1) 35 | % z=min(0.99,x); 36 | % return; 37 | % error('Usage: hypergeometric2f1(a,b,c,x,n) --> |x| has to be less than 1') 38 | % end 39 | 40 | if (c <= 0 & c == floor(c)) 41 | error('Usage: hypergeometric2f1(a,b,c,x,n) --> c != 0, -1, -2, -3, ...') 42 | end 43 | 44 | z = 0; 45 | m = 0; 46 | while (m> klt(infile.wav,outfile.wav); 10 | >> pklt(infile.wav,outfile.wav); 11 | 12 | ----------------------------------------------------------------------------- 13 | REFERENCES 14 | [20] Hu, Y. and Loizou, P. (2003). A generalized subspace approach for 15 | enhancing speech corrupted by colored noise. IEEE Trans. on Speech 16 | and Audio Processing, 11, 334-341. 17 | [21] Jabloun, F. and Champagne, B. (2003). Incorporating the human hearing 18 | properties in the signal subspace approach for speech enhancement. IEEE 19 | Trans. on Speech and Audio Processing, 11(6), 700-708. 20 | 21 | Copyright (c) 2006 by Philipos C. Loizou 22 | $Revision: 0.0 $ $Date: 07/30/2006 $ 23 | ------------------------------------------------------------------------------- -------------------------------------------------------------------------------- /matlab_lib/sub_lib/MATLAB_code/subspace/sp04_babble_sn10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/MATLAB_code/subspace/sp04_babble_sn10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/.gitignore: -------------------------------------------------------------------------------- 1 | /populate_readme.m 2 | 3 | /*.zip -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/ALcons2STI.m: -------------------------------------------------------------------------------- 1 | function [ STIval ] = ALcons2STI( ALcons ) 2 | % Converts Articulation Loss of Consonants (ALcons) to the Speech Transmission Index (STI) 3 | % 4 | % Syntax: [STIval] = ALcons2STI( ALcons ) 5 | % Pass the Articulation Loss of Consonants (ALcons) value to the 6 | % function to retrieve the STI value. 7 | % 8 | % Inputs: 9 | % ALcons - Articulation Loss of Consonants value 10 | % 11 | % Outputs: 12 | % STIval - Corresponding Speech Transmission Index value 13 | % 14 | % 15 | % Author: Jacob Donley 16 | % University of Wollongong 17 | % Email: jrd089@uowmail.edu.au 18 | % Version: 1.0 (12 April 2017) 19 | % Version: 0.1 (30 September 2015) 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | STIval = -0.1845 * log(ALcons) + 0.9482; 24 | 25 | end 26 | 27 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/ArbitraryOctaveFilt.m: -------------------------------------------------------------------------------- 1 | function y = ArbitraryOctaveFilt(x, SPECT, FREQS, N, fs, octBandwidth) 2 | % Filters a signal with any arbitrary spectrum smoothed with any fractional octave band average 3 | % 4 | % Syntax: Y = ARBITRARYOCTAVEFILT(X, SPECT, FREQS, N, FS, OCTBANDWIDTH) 5 | % 6 | % Inputs: 7 | % x - Input signal to filter as a vector 8 | % SPECT - The spectrum to shape the input signal to 9 | % FREQS - The frequencies of each SPECT element 10 | % N - The length of the filter to usee 11 | % fs - Description 12 | % octBandwidth - Description 13 | % 14 | % Outputs: 15 | % y - Description 16 | % 17 | % Example: 18 | % fs = 16000; 19 | % T = 10; 20 | % N = 1000; 21 | % f = linspace(0,fs/2,N); 22 | % s = 1./f; 23 | % x = wgn(T*fs,1,0); 24 | % y = ArbitraryOctaveFilt(x,s,f,N,fs,1/3); 25 | % pwelch([x y]); 26 | % 27 | % See also: fir2, filter 28 | 29 | % Author: Jacob Donley 30 | % University of Wollongong 31 | % Email: jrd089@uowmail.edu.au 32 | % Copyright: Jacob Donley 2017 33 | % Date: 06 June 2016 34 | % Revision: 0.1 35 | % 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | if nargin < 6 38 | octBandwidth = 1/6; 39 | end 40 | 41 | % Find nth-octave averages 42 | [MAG,f]=Tools.octaveBandMean(SPECT,FREQS,octBandwidth); 43 | 44 | % Force even length filter 45 | if isempty(N), if mod(length(SPECT),2), N=length(SPECT)-1; else N=length(SPECT); end; end 46 | % Design arbitrary magnitude (linear-phase) filter 47 | b = fir2(N,f/(fs/2),MAG); 48 | % Apply filter 49 | y = filter(b,1,x); 50 | 51 | 52 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/COSHdist.m: -------------------------------------------------------------------------------- 1 | function [E,Eps] = COSHdist(H,P) 2 | % Finds the symmetric Itakura-Saito distance using the hyperbolic cosine function 3 | % 4 | % Syntax: [OUTPUTARGS] = COSHDIST(INPUTARGS) Explain usage here 5 | % 6 | % Inputs: 7 | % input1 - Description 8 | % input2 - Description 9 | % input3 - Description 10 | % 11 | % Outputs: 12 | % output1 - Description 13 | % output2 - Description 14 | % 15 | % Example: 16 | % Line 1 of example 17 | % Line 2 of example 18 | % Line 3 of example 19 | % 20 | % See also: List related files here 21 | 22 | % Author: Jacob Donley 23 | % University of Wollongong 24 | % Email: jrd089@uowmail.edu.au 25 | % Copyright: Jacob Donley 2017 26 | % Date: 24 October 2016 27 | % Revision: 0.1 28 | % 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | [~,X]=size(P); 32 | Hx = repmat(H(:),1,X); 33 | 34 | % K = numel(H); 35 | % E = 1/K *... 36 | % sum( ... 37 | % abs(Hx)./P ... 38 | % - log( abs(Hx)./P ) ... 39 | % + P./abs(Hx) ... 40 | % - log( P./abs(Hx) ) ... 41 | % - 2 ) / 2; 42 | 43 | E = mean( cosh( log( Hx./P ) ) - 1 ); 44 | 45 | Eps = mean(E); 46 | 47 | end 48 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/Correlated_Normalisation.m: -------------------------------------------------------------------------------- 1 | function [ X_Approx_Adjust, Scaling_Factor ] = correlated_normalisation( X, X_Approx ) 2 | % Matches the amplitude of X using cross-correlation 3 | % 4 | % Syntax: [ X_Approx_Adjust, Scaling_Factor ] = CORRELATED_NORMALISATION( X, X_Approx ) 5 | % 6 | % Inputs: 7 | % X - Original signal 8 | % X_Approx - Approximation of the original signal 9 | % 10 | % Outputs: 11 | % X_Approx_Adjust - The approximate signal with a magnitude closely 12 | % matching the original signal 13 | % Scaling_Factor - The adjustment factor required 14 | 15 | % Author: Jacob Donley 16 | % University of Wollongong 17 | % Email: jrd089@uowmail.edu.au 18 | % Copyright: Jacob Donley 2017 19 | % Date: 19 June 2015 20 | % Revision: 0.1 21 | % 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | 25 | corr = xcorr( X, X_Approx); 26 | peakVal = max(abs(corr)); 27 | Energy = sum( X .^ 2 ); 28 | 29 | if isnan(peakVal) 30 | peakVal = mean([max(abs(X)), max(abs(X_Approx))]); 31 | end 32 | 33 | Scaling_Factor = peakVal / Energy; 34 | 35 | X_Approx_Adjust = X_Approx * 1/Scaling_Factor; 36 | 37 | end 38 | 39 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/Dropbox.m: -------------------------------------------------------------------------------- 1 | function [ res, cmd_out ] = Dropbox( action ) 2 | % Function to start and kill dropbox from MATLAB 3 | % 4 | % Syntax: [ res, cmd_out ] = Dropbox( action ) 5 | % 6 | % Inputs: 7 | % action - Action to perform. Either 'start' or 'kill. 8 | % 9 | % Outputs: 10 | % res - Command exit status 11 | % cmd_out - Output of the operating system command 12 | % 13 | % Author: Jacob Donley 14 | % University of Wollongong 15 | % Email: jrd089@uowmail.edu.au 16 | % Copyright: Jacob Donley 2017 17 | % Date: 3 October 2015 18 | % Revision: 0.1 19 | % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | switch lower(action) 23 | case 'start' 24 | [res, cmd_out] = dos('start "" "%APPDATA%\Dropbox\bin\Dropbox.exe" & exit'); 25 | disp('... Started Dropbox'); 26 | 27 | case 'kill' 28 | [res, cmd_out] = dos('taskkill /F /IM Dropbox.exe'); 29 | if res==0, disp('Terminated Dropbox ...'); end 30 | 31 | otherwise 32 | error('Dropbox action not supported...'); 33 | end 34 | 35 | end 36 | 37 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/IRcompactingKirkebyFilter.m: -------------------------------------------------------------------------------- 1 | function [ filt ] = IRcompactingKirkebyFilter( ir, ir_len, f_band, fs, reg ) 2 | % Compacting Kirkeby Filter 3 | 4 | % Regularisation parameter 5 | ereg = epsreg(ir_len*fs,f_band,fs,reg); 6 | 7 | % Time-packing filtering 8 | H = fft(ir, ir_len*fs); 9 | 10 | C = conj(H) ./ (conj(H).*H + ereg); 11 | 12 | filt = ifft(C); 13 | 14 | end 15 | 16 | function ereg = epsreg(Nfft, f_band, fs, reg) 17 | f1=f_band(1); 18 | f2=f_band(2); 19 | reg_in=reg(1); 20 | reg_out=reg(2); 21 | if f1 > 0 && f2 < fs/2 22 | freq=(0:fs/(Nfft-1):fs/2)'; 23 | f1e=f1-f1/3; 24 | f2e=f2+f2/3; 25 | if f1e < freq(1) 26 | f1e=f1; 27 | f1=f1+1; 28 | end 29 | if f2e > freq(end) 30 | f2e=f2+1; 31 | end 32 | % regularization B with 1/3 octave interpolated transient edges 33 | B=interp1([0 f1e f1 f2 f2e freq(end)],[reg_out reg_out reg_in reg_in reg_out reg_out],freq,'PCHIP'); 34 | B = db2mag(-B); % from dB to linear 35 | B=vertcat(B,B(end:-1:1)); 36 | b=ifft(B,'symmetric'); 37 | b=circshift(b,Nfft/2); 38 | b=0.5*(1-cos(2*pi*(1:Nfft)'/(Nfft+1))).*b; 39 | b=minph(b); % make regularization minimum phase 40 | B=fft(b,Nfft); 41 | else 42 | B=0; 43 | end 44 | ereg = (conj(B).*B); 45 | end 46 | 47 | % calculate minimum phase component of impulse response 48 | function [h_min] = minph(h) 49 | n = length(h); 50 | h_cep = real(ifft(log(abs(fft(h(:,1)))))); 51 | odd = fix(rem(n,2)); 52 | wn = [1; 2*ones((n+odd)/2-1,1) ; ones(1-rem(n,2),1); zeros((n+odd)/2-1,1)]; 53 | h_min = zeros(size(h(:,1))); 54 | h_min(:) = real(ifft(exp(fft(wn.*h_cep(:))))); 55 | if size(h,2)==2 56 | h_cep = real(ifft(log(abs(fft(h(:,2)))))); 57 | odd = fix(rem(n,2)); 58 | wn = [1; 2*ones((n+odd)/2-1,1) ; ones(1-rem(n,2),1); zeros((n+odd)/2-1,1)]; 59 | h_minr = zeros(size(h(:,2))); 60 | h_minr(:) = real(ifft(exp(fft(wn.*h_cep(:))))); 61 | h_min=[h_min h_minr]; 62 | end 63 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/MiKTeX_FNDB_Refresh.m: -------------------------------------------------------------------------------- 1 | function [ res, cmd_out ] = MiKTeX_FNDB_Refresh( ) 2 | % Function to refresh the File Name DataBase in MiKTeX 3 | % 4 | % Syntax: [ res, cmd_out ] = MiKTeX_FNDB_Refresh() This is used after 5 | % exporting a file (i.e. figure) to a tex directory so that a direct comilation 6 | % of a tex document will show the updated files. 7 | % 8 | % Outputs: 9 | % res - Command exit status 10 | % cmd_out - Output of the operating system command 11 | % 12 | % Author: Jacob Donley 13 | % University of Wollongong 14 | % Email: jrd089@uowmail.edu.au 15 | % Copyright: Jacob Donley 2017 16 | % Date: 03 October 2015 17 | % Revision: 0.1 18 | % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | 21 | [res, cmd_out] = system('initexmf --update-fndb'); 22 | disp('Refreshed MiKTeX FNDB'); 23 | 24 | end 25 | 26 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/STI.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/STI.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/STI_BandFilters.m: -------------------------------------------------------------------------------- 1 | function OctaveFilters = STI_BandFilters( N, fs ) 2 | % Calculation of the Speech Transmission Index (STI) Band Filters 3 | % 4 | % Syntax: OctaveFilters = STI_BandFilters( N, fs ) 5 | % This function calculates the Speech Transmission Index octave band 6 | % filters from 125Hz to 8kHz so they can be passed to the STI 7 | % function for faster computation. 8 | % 9 | % Inputs: 10 | % N - Filter order (recommended: 6) 11 | % fs - Sampling frequency of the STI inputs 12 | % 13 | % Outputs: 14 | % OctaveFilters - An array of octave band filters 15 | % 16 | % Example: 17 | % y=sinc(-7999:8000); 18 | % fs=16000; 19 | % N = 6; 20 | % H = STI_BandFilters( N, fs ) 21 | % tic; 22 | % [STIval,ALcons,STIval_,ALcons_]=STI(y,fs,H) 23 | % toc 24 | % [STIval,ALcons,STIval_,ALcons_]=STI(y,fs) 25 | % toc 26 | % 27 | % See also: STI.m 28 | 29 | % Author: Jacob Donley 30 | % University of Wollongong 31 | % Email: jrd089@uowmail.edu.au 32 | % Version: 1.0 (12 April 2017) 33 | % Version: 0.1 (30 September 2015) 34 | % 35 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 | 37 | BandsPerOctave = 1; 38 | F0 = 1000; % Center Frequency (Hz) 39 | f = fdesign.octave(BandsPerOctave,'Class 1','N,F0',N,F0,fs); 40 | F0 = validfrequencies(f); 41 | F0(F0<125 | F0>min([8000,fs/2]))=[]; % Only keep bands in the range required for the STI calculation 42 | Nfc = length(F0); 43 | 44 | for i=1:Nfc 45 | f.F0 = F0(i); 46 | OctaveFilters(i) = design(f,'butter'); 47 | end 48 | 49 | end 50 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/addNoise.m: -------------------------------------------------------------------------------- 1 | function [x_n] = addNoise( x, level, type ) 2 | % Adds a given level and type of noise to a signal 3 | % 4 | % Syntax: [x_n] = ADDNOISE( x, level, type ) Pass the signal, x, level 5 | % and type of noise to the function and x_n will be the resulting signal 6 | % with the noise added. 7 | % 8 | % Inputs: 9 | % x - The input signal to add noise to 10 | % level - The noise in dB relative to the input signal 11 | % type - The type of noise to add 12 | % 13 | % Outputs: 14 | % x_n - The noisey output signal 15 | % 16 | % 17 | % Author: Jacob Donley 18 | % University of Wollongong 19 | % Email: jrd089@uowmail.edu.au 20 | % Copyright: Jacob Donley 2017 21 | % Date: 21 August 2015 22 | % Revision: 0.1 23 | % 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | x_n = Tools.generateNoise( x, level, type, true); 27 | 28 | end 29 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/DC_block.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/DC_block.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/FFTNXCorr.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/FFTNXCorr.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/apply_VAD.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/apply_VAD.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/apply_filter.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/apply_filter.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/apply_filters.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/apply_filters.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/batch_pesq.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/batch_pesq.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/batch_pesq2.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/batch_pesq2.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/composite.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/composite.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/convolution_in_timealign.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/convolution_in_timealign.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/crude_align.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/crude_align.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/enhanced_logmmse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/enhanced_logmmse.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/fix_power_level.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/fix_power_level.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/id_searchwindows.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/id_searchwindows.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/id_utterances.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/id_utterances.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/input_filter.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/input_filter.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_debug.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_debug.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_measure.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_measure.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_psychoacoustic_model.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_psychoacoustic_model.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_testbench.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pesq_testbench.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/plot_wav.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/plot_wav.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pow_of.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/pow_of.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/readme.pdf -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/readme.txt -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/setup_global.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/setup_global.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/sp09.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/sp09.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/sp09_babble_sn10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/sp09_babble_sn10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/split_align.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/split_align.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/time_align.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/time_align.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/utterance_locate.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/utterance_locate.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/utterance_split.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/composite/utterance_split.p -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/extractIR.m: -------------------------------------------------------------------------------- 1 | function [irLin, irNonLin] = extractIR(sweep_response, invsweepfft) 2 | % Extract impulse response from swept-sine response. 3 | % [irLin, irNonLin] = extractIR(sweep_response, invsweepfft) 4 | % Extracts the impulse response from the swept-sine response. Use 5 | % synthSweep.m first to create the stimulus; then pass it through the 6 | % device under test; finally, take the response and process it with the 7 | % inverse swept-sine to produce the linear impulse response and 8 | % non-linear simplified Volterra diagonals. The location of each 9 | % non-linear order can be calculated with the sweepRate - this will be 10 | % implemented as a future revision. 11 | % 12 | % Developed at Oygo Sound LLC 13 | % 14 | % Equations from Muller and Massarani, "Transfer Function Measurement 15 | % with Sweeps." 16 | % 17 | % Modified by Jacob Donley (jrd089@uowmail.edu.au) (January 2017) 18 | 19 | if diff(size(sweep_response))>0, sweep_response = sweep_response.'; end 20 | if diff(size(invsweepfft))>0, invsweepfft = invsweepfft.'; end 21 | 22 | N = length(invsweepfft); 23 | sweepfft = fft(sweep_response,N); 24 | 25 | %%% convolve sweep with inverse sweep (freq domain multiply) 26 | invsweepfft = repmat(invsweepfft,1,size(sweepfft,2)); 27 | ir = real(ifft(invsweepfft.*sweepfft)); 28 | 29 | ir = circshift(ir, length(ir)/2, 1); 30 | 31 | irLin = ir(end/2+1:end,:); 32 | irNonLin = ir(1:end/2,:); 33 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/fconv.m: -------------------------------------------------------------------------------- 1 | function [y]=fconv(x, h) 2 | % Fast Parallelised Convolution 3 | % [y] = FCONV(x, h) convolves x and h in the frequency domain 4 | % to +-1. 5 | % 6 | % x = input vector 7 | % h = input vector 8 | % 9 | % See also CONV 10 | % 11 | 12 | Ly=size(x,1)+size(h,1)-1; % 13 | Ly2=pow2(nextpow2(Ly)); % Find smallest power of 2 that is > Ly 14 | 15 | if isa(x, 'gpuArray') 16 | Ly = gpuArray(Ly); 17 | Ly2 = gpuArray(Ly2); 18 | end 19 | 20 | X=fft(x, Ly2); % Fast Fourier transform 21 | H=fft(h, Ly2); % Fast Fourier transform 22 | Y=X.*H; % 23 | y=real(ifft(Y, Ly2)); % Inverse fast Fourier transform 24 | y=y(1:1:Ly,:); % Take just the first N elements -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/fdeconv.m: -------------------------------------------------------------------------------- 1 | function [h]=fdeconv(x, y) 2 | % Fast Parallelised Deconvolution 3 | % [h] = FDECONV(x, y) deconvolves x and y in the frequency domain 4 | % 5 | % x = input vector (original) 6 | % y = input vector (altered) 7 | % 8 | % See also DECONV 9 | % 10 | 11 | Lh=size(y,1)-size(x,1)+1; % 12 | Lh2=pow2(nextpow2(Lh)); % Find smallest power of 2 that is > Ly 13 | 14 | if isa(x, 'gpuArray') 15 | Lh = gpuArray(Lh); 16 | Lh2 = gpuArray(Lh2); 17 | end 18 | 19 | X=fft(x, Lh2); % Fast Fourier transform 20 | Y=fft(y, Lh2); % Fast Fourier transform 21 | H=Y./X; % 22 | h=real(ifft(H, Lh2)); % Inverse fast Fourier transform 23 | h=h(1:1:Lh,:); % Take just the first N elements -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/interpVal.m: -------------------------------------------------------------------------------- 1 | function [ interpolated_values, interpolated_indices] = interpVal( values, index_values, desired_index_values ) 2 | % This function will interpolate from desired arbitrarily spaced index values 3 | % 4 | % Syntax: [ interpolated_values, interpolated_indices] = interpVal( values, index_values, desired_index_values ) 5 | % 6 | % Inputs: 7 | % values - A 1D array of values to interpolate between 8 | % index_values - The axis values of the array 9 | % desired_index_values - The desired axis values to interpolate to 10 | % (Can be spaced abitrarily) 11 | % 12 | % Outputs: 13 | % interpolated_values - The new interpolated values 14 | % interpolated_indices - The new interpolated indices 15 | % 16 | % Example: 17 | % 18 | % See also: interp1 19 | 20 | % Author: Jacob Donley 21 | % University of Wollongong 22 | % Email: jrd089@uowmail.edu.au 23 | % Copyright: Jacob Donley 2015-2017 24 | % Date: 15 August 2017 25 | % Version: 0.2 (15 August 2017) 26 | % Version: 0.1 (03 October 2015) 27 | % 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | 30 | % center desireable value 31 | temp = repmat(index_values, [length(desired_index_values) 1]) ... 32 | - repmat(desired_index_values', [1 length(index_values)]); 33 | temp(temp > 0) = NaN; 34 | 35 | N = numel(index_values); 36 | [~, i_low] = min(abs(temp), [], 2); 37 | i_low = (i_low - (i_low>N).*(i_low-N))'; 38 | i_high = i_low + (N~=1); 39 | i_high(i_high>N) = N; 40 | 41 | num = (desired_index_values - index_values(i_low)); 42 | den = (index_values(i_high) - index_values(i_low)); 43 | 44 | div = num ./ den; 45 | div(num==0&den==0)=0; % redefine zero devided by zero as 0/0=0 46 | 47 | interpolated_indices = div + i_low; 48 | 49 | interpolated_values = interp1(values, interpolated_indices); 50 | 51 | end 52 | 53 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/invSweepFFT.m: -------------------------------------------------------------------------------- 1 | function [ invirfft ] = invSweepFFT( y, f1, f2, fs, Nfft ) 2 | % Obtain the FFT of an inverted exponentional sine sweep 3 | % Detailed explanation goes here 4 | if nargin < 5 5 | Nfft = length(y); 6 | end 7 | 8 | %%% get fft of sweep to verify that its okay and to use for inverse 9 | yfft = fft(y(:)', Nfft); 10 | 11 | % start with the true inverse of the sweep fft 12 | invirfft = 1./yfft; 13 | 14 | 15 | %%% Create band pass magnitude to start and stop at desired frequencies 16 | [B1, A1] = butter(2,f1/(fs/2),'high' ); %%% HP at f1 17 | [B2, A2] = butter(2,f2/(fs/2)); %%% LP at f2 18 | 19 | %%% so we need to re-apply the band pass here to get rid of that 20 | H1 = freqz(B1,A1,length(yfft),fs,'whole'); 21 | H2 = freqz(B2,A2,length(yfft),fs,'whole'); 22 | 23 | %%% apply band pass filter to inverse magnitude 24 | invirfft = invirfft .* abs(H1)' .* abs(H2)'; 25 | 26 | end 27 | 28 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/invsweepfft.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/invsweepfft.mat -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/keepFilesFromFolder.m: -------------------------------------------------------------------------------- 1 | function [Files] = keepFilesFromFolder( FileList, KeepFromFolder ) 2 | % Keeps files and file paths in a cell array if the file names in a given folder are found in the path string 3 | % 4 | % Syntax: [Files] = KEEPFILESFROMFOLDER(FileList,KeepFromFolder) 5 | % 6 | % Inputs: 7 | % FileList - A list of files to filter 8 | % KeepFromFolder - A folder containing filenames from which to search in 9 | % the given FileList and keep. 10 | % 11 | % Outputs: 12 | % Files - List of files with only the file names found in the given 13 | % folder still in the list 14 | % 15 | % 16 | % See also: getAllFiles 17 | 18 | % Author: Jacob Donley 19 | % University of Wollongong 20 | % Email: jrd089@uowmail.edu.au 21 | % Copyright: Jacob Donley 2017 22 | % Date: 18 January 2017 23 | % Revision: 0.1 24 | % 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | % Just incase this function tries to call within a class folder we 28 | % should create a function handle for other functions in that class folder 29 | inf = dbstack('-completenames'); 30 | funcName = 'getAllFiles'; 31 | funcPath = inf.file; 32 | classDirs = getClassDirs(funcPath); 33 | getAllFilesFn = str2func([classDirs funcName]); 34 | 35 | 36 | %% KEEPFILESFROMFOLDER 37 | [~,fnames]=cellfun(@fileparts, getAllFilesFn( KeepFromFolder ),'UniformOutput',false); 38 | for i=1:numel(fnames) 39 | tmp = strfind(FileList,fnames{i}); 40 | I = arrayfun(@(x) ~isempty(tmp{x}),1:numel(FileList)); 41 | fileKeeps(I) = FileList(I); 42 | end 43 | fileKeeps(cellfun('isempty',fileKeeps))=[]; 44 | Files = {fileKeeps{:}}.'; 45 | 46 | 47 | end 48 | 49 | function classDirs = getClassDirs(FullPath) 50 | classDirs = ''; 51 | classes = strfind(FullPath,'+'); 52 | for c = 1:length(classes) 53 | clas = FullPath(classes(c):end); 54 | stp = strfind(clas,filesep); 55 | classDirs = [classDirs clas(2:stp(1)-1) '.']; 56 | end 57 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq.exe -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq3.m: -------------------------------------------------------------------------------- 1 | function [ res ] = pesq3( reference_sig, degraded_sig, Fs, fileNum ) 2 | % A wrapper for the objective Perceptual Evaluation of Speech Quality measure 3 | % 4 | % Syntax: [ res ] = pesq3( reference_sig, degraded_sig, Fs, fileNum ) 5 | % 6 | % Inputs: 7 | % reference_sig - Reference (clean, talker, sender) speech signal 8 | % degraded_sig - Degraded (noisy, listener, receiver) speech signal 9 | % Fs - Sampling Frequency 10 | % fileNum - An ID number to append to the temporary audio files. Useful 11 | % when several instances are to be run together (in parallel). 12 | % 13 | % Outputs: 14 | % res - Raw PESQ result for narrowband and MOS-LQO result for wideband 15 | % 16 | % See also: pesq2mos.m 17 | 18 | % Author: Jacob Donley 19 | % University of Wollongong 20 | % Email: jrd089@uowmail.edu.au 21 | % Copyright: Jacob Donley 2017 22 | % Date: 03 October 2015 23 | % Revision: 0.1 24 | % 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | if nargin < 4 28 | fileNum = 0; 29 | end 30 | temp_path = [pwd filesep '+Miscellaneous/+Temporary/']; 31 | ref_path = [ 'tmp_ref' num2str(fileNum) '.wav']; 32 | deg_path = [ 'tmp_deg' num2str(fileNum) '.wav']; 33 | 34 | if ~exist(temp_path,'dir'); mkdir(temp_path); end 35 | 36 | max_val = max(abs([reference_sig(:); degraded_sig(:)])); 37 | 38 | audiowrite([temp_path ref_path], reference_sig / max_val, Fs); 39 | audiowrite([temp_path deg_path], degraded_sig / max_val, Fs); 40 | 41 | res = pesq2_mtlb(ref_path, ... 42 | deg_path, ... 43 | Fs, 'wb', [pwd filesep '+Tools/pesq_NoResFile.exe'], ... 44 | temp_path); 45 | 46 | end 47 | 48 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_NoResFile.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_NoResFile.exe -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_mex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_mex.mexa64 -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_mex.mexw64 -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_mex_fast.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_mex_fast.mexw64 -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/pesq_results.txt: -------------------------------------------------------------------------------- 1 | REFERENCE DEGRADED PESQMOS MOSLQO SAMPLE_FREQ MODE 2 | /tmp/tpeac718cb_f5ba_447b_a9e9_62da67a70e3e.wav /tmp/tpd9925cd9_cd7e_4987_b52b_5b3fec8708c1.wav -1.000 1.152 16000 wb 3 | /tmp/tp61effd8d_bf3f_4c16_9b5c_bc5f16ec7390.wav /tmp/tp2e0038eb_78d7_41e1_a1db_bdb84284d3a6.wav 1.823 1.503 16000 nb 4 | /tmp/tp30650e04_d4b7_43b3_be38_3aa998fd1f95.wav /tmp/tpa08dfc26_7c3f_488c_9e36_45455c38ce42.wav 1.332 1.258 16000 nb 5 | /tmp/tp0c98b854_403d_4af9_95ec_4d76f0c8ca5c.wav /tmp/tp31b04ec5_12b4_4b3a_85ae_10cfd6d664e1.wav 2.705 2.399 16000 nb 6 | /tmp/tpad80da5b_c6a1_4c75_9248_d3c2315d5fac.wav /tmp/tp255404c2_0eed_4bb5_a755_83b79cfb3da1.wav 2.293 1.901 16000 nb 7 | /tmp/tpb151adbd_9ec0_4a5b_adf7_3e94014f40ab.wav /tmp/tpa2d0325b_9407_4771_9658_6b595b87d27a.wav 3.193 3.110 16000 nb 8 | /tmp/tp3aaac446_2ac1_4cc4_9aa5_e78cbac5b716.wav /tmp/tp52d95a1a_8613_41c2_9028_23a3ad85528c.wav 2.788 2.514 16000 nb 9 | /tmp/tpdd4d433a_fb4f_49aa_8554_27cbd5e75a60.wav /tmp/tpe0056ff8_cb04_407e_9c28_fa0063005b6d.wav 2.813 2.550 16000 nb 10 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/printHyperlink.m: -------------------------------------------------------------------------------- 1 | function printHyperlink( URL, OptionalText ) 2 | % Prints a hyperlink to the command window 3 | % 4 | % Syntax: PRINTHYPERLINK( URL, OPTIONALTEXT) 5 | % 6 | % Inputs: 7 | % URL - Address for the hyperlink 8 | % OptionalText - The text to be printed which is hyperlinked 9 | % 10 | % See also: fprintf, cprintf 11 | 12 | % Author: Jacob Donley 13 | % University of Wollongong 14 | % Email: jrd089@uowmail.edu.au 15 | % Copyright: Jacob Donley 2017 16 | % Date: 16 February 2017 17 | % Revision: 0.2 (30 March 2017) 18 | % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | if nargin < 2 21 | OptionalText = URL; 22 | end 23 | fprintf(['' OptionalText '\n']); 24 | if exist('cprintf','file') 25 | cprintf('hyper', ''); 26 | end 27 | 28 | end 29 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/repmatmatch.m: -------------------------------------------------------------------------------- 1 | function A = repmatmatch(a,B) 2 | %Replicate and tile an array to match the size of a given N-D array 3 | % 4 | % Syntax: A = repmatmatch(a,B) 5 | % 6 | % Inputs: 7 | % a - Input array to tile 8 | % B - N-D array to match the size of 9 | % 10 | % Outputs: 11 | % A - The replicated and tiled copy of input 'a' 12 | % 13 | % Example: 14 | % a = [1 2 3]; 15 | % B = rand(2,3); 16 | % A = repmatmatch(a,B); 17 | % 18 | % See also: repmat 19 | 20 | % Author: Jacob Donley 21 | % University of Wollongong 22 | % Email: jrd089@uowmail.edu.au 23 | % Copyright: Jacob Donley 2017 24 | % Date: 28 August 2017 25 | % Version: 0.1 (28 August 2017) 26 | % 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | aSz = size(a); 30 | BSz = size(B); 31 | 32 | if any(rem(BSz ./ aSz,1)) 33 | error(['The size of each dimension of ''a'' should match ''B'' ' ... 34 | 'or be evenly divisible by the corresponding dimension of ''B''.']) 35 | end 36 | 37 | A = repmat(a, BSz ./ aSz); 38 | 39 | end 40 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/shapeSpectrum.m: -------------------------------------------------------------------------------- 1 | function [ y_shaped ] = shapeSpectrum( y, spectrum, freqs, fs ) 2 | % This function will shape an input signal to the given spectrum (simple, unregulated spectral shaping) 3 | % 4 | % Syntax: [ y_shaped ] = shapeSpectrum( y, fs, spectrum ) 5 | % 6 | % Inputs: 7 | % y - Input signal in the time-domain which requires shaping. 8 | % spectrum - A vector containing the magnitude spectrum to shape the 9 | % signal with. ( length = fs/2 - 1 ) 10 | % freqs - A vector containing the corresponding frequencies for the 11 | % spectrum vector. 12 | % 13 | % Outputs: 14 | % y_shaped - The input signal shaped to the given spectrum 15 | % 16 | % 17 | 18 | % Author: Jacob Donley 19 | % University of Wollongong 20 | % Email: jrd089@uowmail.edu.au 21 | % Copyright: Jacob Donley 2017 22 | % Date: 26 February 2016 23 | % Revision: 0.1 24 | % 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | N = length( y ); 27 | 28 | if rem(N,2) 29 | M = N+1; 30 | else 31 | M = N; 32 | end 33 | 34 | % Frequency Domain Tranform 35 | Y = fft(y); % Fast Fourier Transform 36 | 37 | % Frequencies 38 | NumPts = M/2 + 1; 39 | freqs_new = linspace(0, fs/2, NumPts); 40 | 41 | % Create correct size spectrum vector 42 | spect = interp1( freqs, spectrum, freqs_new )'; 43 | 44 | % Apply magnitude weighting 45 | Y(1:NumPts) = Y(1:NumPts) .* spect; 46 | 47 | % Apply conjugation for negative frequency side of spectrum 48 | Y(NumPts+1:M) = conj(Y(M/2:-1:2)); 49 | 50 | % Time Domain Transform 51 | y_shaped = ifft(Y); % Inverse Fast Fourier Transform 52 | 53 | % prepare output vector y 54 | y_shaped = real(y_shaped(1:N)); 55 | 56 | % ensure unity standard deviation and zero mean value 57 | y_shaped = y_shaped - mean(y_shaped); 58 | y_shaped = y_shaped / rms(y_shaped); 59 | 60 | 61 | % BETTER METHOD %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 62 | 63 | end 64 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/simpleWarning.m: -------------------------------------------------------------------------------- 1 | function simpleWarning( warning_text, text_colour ) 2 | % Prints a coloured warning without the location information 3 | % 4 | % Syntax: SIMPLEWARNING(warning_text, text_colour) 5 | % 6 | % Inputs: 7 | % warning_text - 1D character array or 2D cell array of warning text 8 | % where each cell contains a line of text. 9 | % text_colour - RGB text colour as 1x3 matrix. 10 | % 11 | % See also: warning, error, cprintf 12 | 13 | % Author: Jacob Donley 14 | % University of Wollongong 15 | % Email: jrd089@uowmail.edu.au 16 | % Copyright: Jacob Donley 2017 17 | % Date: 16 February 2017 18 | % Revision: 0.2 (30 March 2017) 19 | % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | if nargin < 2 23 | text_colour = [255,100,0]/255; 24 | end 25 | 26 | if ischar(warning_text) 27 | warning_text = {warning_text ''}; 28 | end 29 | 30 | if exist('cprintf','file') 31 | for l = 1:numel(warning_text)-1 32 | cprintf(text_colour, [warning_text{l} ' \n']); 33 | end 34 | if isempty(l),l=0;end 35 | cprintf(text_colour, [warning_text{l+1}]); 36 | else 37 | wTxtTemp=[]; 38 | for l = 1:numel(warning_text) 39 | wTxtTemp = [wTxtTemp warning_text{l} ' ']; 40 | end 41 | warning(wTxtTemp); 42 | end 43 | 44 | end 45 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/sineSweepLin.m: -------------------------------------------------------------------------------- 1 | function [ y ] = sineSweepLin( f_start, f_end, dur, fs ) 2 | % Synthesize a linear sine sweep 3 | % Detailed explanation goes here 4 | t=0:1/fs:dur-1/fs; 5 | f=linspace(f_start,(f_end+f_start)/2,length(t)); 6 | y=sin(2*pi*f.*t); 7 | end 8 | 9 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/stoi_d2percCorr.m: -------------------------------------------------------------------------------- 1 | function [stoi_PercCorr] = stoi_d2percCorr(stoi_d) 2 | % Converts the stoi measure, d, to percent words correct unit 3 | % 4 | % Syntax: [stoi_PercCorr] = stoi_d2percCorr(stoi_d) 5 | % 6 | % Inputs: 7 | % stoi_d - The STOI measure in the raw units 8 | % 9 | % Outputs: 10 | % stoi_PercCorr - The corressponding STOI value in Percent of Words 11 | % Correct as defined for the IEEE English Library 12 | % 13 | % 14 | % References: 15 | % C. H. Taal, R. C. Hendriks, R. Heusdens, and J. Jensen. A Short-Time 16 | % Objective Intelligibility Measure for Time-Frequency Weighted Noisy 17 | % Speech. In Acoustics Speech and Signal Processing (ICASSP), pages 18 | % 4214-4217. IEEE, 2010. 19 | % 20 | % C. H. Taal, R. C. Hendriks, R. Heusdens, and J. Jensen. An Algorithm 21 | % for Intelligibility Prediction of Time-Frequency Weighted Noisy Speech. 22 | % IEEE Transactions on Audio, Speech and Language Processing, 23 | % 19(7):2125-2136, 2011. 24 | 25 | % Author: Jacob Donley 26 | % University of Wollongong 27 | % Email: jrd089@uowmail.edu.au 28 | % Date: 05 August 2015 29 | % Revision: 0.1 30 | % 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | 33 | f_IEEE_a = -17.4906; 34 | f_IEEE_b = 9.6921; 35 | 36 | stoi_PercCorr = 100 / (1 + exp(f_IEEE_a * stoi_d + f_IEEE_b ) ); 37 | 38 | 39 | end 40 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/toepsolveMEX.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/toepsolveMEX.mexw64 -------------------------------------------------------------------------------- /matlab_lib/sub_lib/SoundZone_Tools-master/SoundZone_Tools-master/wait_for_file.m: -------------------------------------------------------------------------------- 1 | function wait_for_file( file_string ) 2 | % A forceful method to wait for a file to finish being written to 3 | % 4 | % Syntax: wait_for_file( file_string ) 5 | % 6 | % Inputs: 7 | % file_string - Absolute or relative path for the file to wait for 8 | % 9 | % 10 | % Author: Jacob Donley 11 | % University of Wollongong 12 | % Email: jrd089@uowmail.edu.au 13 | % Copyright: Jacob Donley 2017 14 | % Date: 03 October 2015 15 | % Revision: 0.1 16 | % 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | 19 | fid = fopen(file_string,'r'); 20 | while fid==-1 21 | fid = fopen(file_string,'r'); 22 | end 23 | fseek(fid,0,'eof'); 24 | char_pos(1) = -1; 25 | char_pos(2) = ftell(fid); 26 | pause(0.5); 27 | while char_pos(1) ~= char_pos(2) 28 | char_pos(1) = char_pos(2); 29 | fseek(fid,0,'eof'); 30 | char_pos(2) = ftell(fid); 31 | pause(0.5); 32 | end 33 | fclose(fid); 34 | end 35 | 36 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/dirPlus/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, Kenneth Eaton 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/noise_add.m: -------------------------------------------------------------------------------- 1 | function [noisy_speech] = noise_add(wav_dir, noise_dir, noise_type, snr) 2 | 3 | desired_fs = 8000.0; 4 | 5 | noise_list = dirPlus(noise_dir, 'FileFilter', '\.(wav)$'); 6 | [audio, speech_fs] = audioread(wav_dir); 7 | noise_list{noise_type} 8 | [noise, noise_fs] = audioread(noise_list{noise_type}); 9 | 10 | audio = resample(audio, desired_fs, speech_fs); 11 | noise = resample(noise, desired_fs, noise_fs); 12 | 13 | noisy_speech = v_addnoise(audio, desired_fs, snr, 'k', noise, desired_fs); 14 | % noisy_speech = audio + noise(1:length(audio)); 15 | % subplot(2,1,1) 16 | % plot(audio) 17 | % subplot(2,1,2) 18 | % plot(noisy_speech) 19 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/sample.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/sample.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/segsnr/pesq_results.txt: -------------------------------------------------------------------------------- 1 | REFERENCE DEGRADED PESQMOS MOSLQO SAMPLE_FREQ MODE 2 | /tmp/tp02fe529d_a985_4e25_a1d1_fb37af903925.wav /tmp/tp7296ccd2_40ce_4919_9e79_635c9c1be485.wav 1.696 1.425 16000 nb 3 | /tmp/tp487336d3_c21a_4f4f_a7b7_231e3a254696.wav /tmp/tp6ec72d16_95a4_41bb_8527_2981827b9436.wav 1.903 1.558 16000 nb 4 | /tmp/tp20585e8b_869e_47d7_9c02_825a099dcefc.wav /tmp/tp27752d69_92d0_4c56_baf4_043375cdf504.wav 1.630 1.389 16000 nb 5 | /tmp/tpada86c78_91e7_461c_b21b_0b3c7e736a6a.wav /tmp/tpad7eccaa_9a0e_4bab_b833_baf6b2a6d317.wav 1.763 1.465 16000 nb 6 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/segsnr/segsnr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/segsnr/segsnr.png -------------------------------------------------------------------------------- /matlab_lib/sub_lib/segsnr/snr_mean.m: -------------------------------------------------------------------------------- 1 | function [SNR] = snr_mean( target, masked ) 2 | % SNR Computes signal-to-noise ratio. 3 | % 4 | % S=SNR(TARGET,MASKED) returns signal-to-noise ratio 5 | % given target and masked speech signals. 6 | % 7 | % Inputs 8 | % TARGET is a target signal as vector. 9 | % 10 | % MASKED is a target+masker signal as vector. 11 | % 12 | % Outputs 13 | % S is the signal-to-noise ratio (dB). 14 | % 15 | % Example 16 | % % read target and masker signals from wav files 17 | % [ target, fs ] = wavread( 'sp10.wav' ); 18 | % [ masker, fs ] = wavread( 'ssn.wav' ); 19 | % 20 | % % desired SNR level (dB) 21 | % dSNR = 5; 22 | % 23 | % % generate mixture signal: noisy = signal + noise 24 | % [ masked, masker ] = addnoise( target, masker, dSNR ); 25 | % 26 | % % compute SNR (dB) 27 | % SNR = snr( target, masked ); 28 | % 29 | % % display the result 30 | % fprintf( 'SNR: %0.2f dB\n', SNR ); 31 | % 32 | % See also ADDNOISE, SEGSNR. 33 | 34 | % Author: Kamil Wojcicki, November 2011. 35 | 36 | % compute the masker (assumes additive noise model) 37 | masker = masked(:) - target(:); 38 | 39 | % compute target and masker frame energies 40 | energy.target = target.' * target; 41 | energy.masker = masker.' * masker + eps; 42 | 43 | % compute frame signal-to-noise ratio (dB) 44 | SNR = 10*log10( energy.target ./ energy.masker + eps ); 45 | SNR 46 | % SNR = 123123123; 47 | 48 | 49 | % EOF 50 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/segsnr/sp10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/segsnr/sp10.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/segsnr/ssn.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/segsnr/ssn.wav -------------------------------------------------------------------------------- /matlab_lib/sub_lib/untitled3.m: -------------------------------------------------------------------------------- 1 | clc 2 | clear 3 | close all 4 | wav_dir = '/home/jtkim/hdd3/github/SE_datamake/datamake/timit_coretest/DR1/FELC0/SA1.WAV'; 5 | % wav_dir = '/home/jtkim/hdd3/github/SE/data/test/clean/clean_num022.wav'; 6 | [clean, fs] = audioread(wav_dir); 7 | 8 | noise_dir = '/home/jtkim/hdd3/github/SE_datamake/datamake/noise/NOISEX-92_16000'; 9 | 10 | noise_type = 15; 11 | snr = 5; 12 | noisy_speech = noise_add(wav_dir, noise_dir, noise_type, snr); 13 | [zz,enhanced] = WienerNoiseReduction(noisy_speech,16000); 14 | 15 | % clean = resample(clean, 8000, fs); 16 | 17 | a = snr_mean(clean, noisy_speech); 18 | [pesq, stoi_val, snr, lsd] = se_eval(clean, noisy_speech, fs) 19 | 20 | enhanced = enhanced ./ max(abs(enhanced)); 21 | [pesq2, stoi_val2, snr2, lsd2] = se_eval(clean(1:length(enhanced)), enhanced, fs) 22 | % noisy_speech = noisy_speech / max(abs(noisy_speech)); 23 | % audiowrite('./sample.wav', noisy_speech, 8000) 24 | 25 | subplot(3,1,1) 26 | plot(clean) 27 | subplot(3,1,2) 28 | plot(noisy_speech) 29 | subplot(3,1,3) 30 | plot(enhanced) 31 | 32 | close all -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/activlevg.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/activlevg.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/atan2sc.m: -------------------------------------------------------------------------------- 1 | function [s,c,r,t]=atan2sc(y,x) 2 | %ATAN2SC sin and cosine of atan(y/x) [S,C,R,T]=(Y,X) 3 | % 4 | % Outputs: 5 | % s sin(t) where tan(t) = y/x 6 | % C cos(t) where tan(t) = y/x 7 | % r sqrt(x^2 + y^2) 8 | % t arctan of y/x 9 | 10 | % Copyright (C) Mike Brookes 2007 11 | % Version: $Id: atan2sc.m 713 2011-10-16 14:45:43Z dmb $ 12 | % 13 | % VOICEBOX is a MATLAB toolbox for speech processing. 14 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 15 | % 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % This program is free software; you can redistribute it and/or modify 18 | % it under the terms of the GNU General Public License as published by 19 | % the Free Software Foundation; either version 2 of the License, or 20 | % (at your option) any later version. 21 | % 22 | % This program is distributed in the hope that it will be useful, 23 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | % GNU General Public License for more details. 26 | % 27 | % You can obtain a copy of the GNU General Public License from 28 | % http://www.gnu.org/copyleft/gpl.html or by writing to 29 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | 32 | 33 | t=NaN; 34 | if y == 0 35 | t=(x<0); 36 | c=1-2*t; 37 | s=0; 38 | r=abs(x); 39 | t=t*pi; 40 | elseif x == 0 41 | s=2*(y>=0)-1; 42 | c=0; 43 | r=abs(y); 44 | t=s*0.5*pi; 45 | elseif (abs(y) > abs(x)) 46 | q = x/y; 47 | u = sqrt(1+q^2)*(2*(y>=0)-1); 48 | s = 1/u; 49 | c = s*q; 50 | r = y*u; 51 | else 52 | q = y/x; 53 | u = sqrt(1+q^2)*(2*(x>=0)-1); 54 | c = 1/u; 55 | s = c*q; 56 | r = x*u; 57 | end 58 | if nargout>3 && isnan(t) 59 | t=atan2(s,c); 60 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/bark2frq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/bark2frq.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/berk2prob.m: -------------------------------------------------------------------------------- 1 | function [p,d]=berk2prob(b) 2 | %BERK2PROB convert Berksons to probability 3 | % 4 | % Inputs: B(M,N) matrix containing Berkson values 5 | % 6 | % Outputs: P(M,N) Corresponding probability values 7 | % D(M,N) Corresponding derivatives dP/dB 8 | % 9 | % Berksons, or log-odds, are a nonlinear scale for measuring 10 | % probability defined by B = log2(P./(1-P)). 11 | % When Berksons are used to measure probability, a logistic 12 | % psychometric function becomes linear. 13 | % 14 | % The inverse function is berk2prob() 15 | 16 | % Copyright (C) Mike Brookes 2014 17 | % Version: $Id: berk2prob.m 4501 2014-04-24 06:28:21Z dmb $ 18 | % 19 | % VOICEBOX is a MATLAB toolbox for speech processing. 20 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 21 | % 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % This program is free software; you can redistribute it and/or modify 24 | % it under the terms of the GNU General Public License as published by 25 | % the Free Software Foundation; either version 2 of the License, or 26 | % (at your option) any later version. 27 | % 28 | % This program is distributed in the hope that it will be useful, 29 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | % GNU General Public License for more details. 32 | % 33 | % You can obtain a copy of the GNU General Public License from 34 | % http://www.gnu.org/copyleft/gpl.html or by writing to 35 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | p=1-1./(1+pow2(b)); 38 | if nargout>1 39 | d=log(2)*p.*(1-p); 40 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/besselratio.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/besselratio.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/choosrnk.m: -------------------------------------------------------------------------------- 1 | function x=choosrnk(n,k) 2 | %CHOOSRNK All choices of K elements taken from 1:N with replacement. [X]=(N,K) 3 | % The output X is a matrix of size ((N+K-1)!/(K!*(N-1)!),K) where each row 4 | % contains a choice of K elements taken from 1:N with duplications allowed. 5 | % The rows of X are in lexically sorted order. 6 | % 7 | % To choose from the elements of an arbitrary vector V use 8 | % V(CHOOSRNK(LENGTH(V),K)). 9 | 10 | % Copyright (c) 1998 Mike Brookes, mike.brookes@ic.ac.uk 11 | % Version: $Id: choosrnk.m 713 2011-10-16 14:45:43Z dmb $ 12 | % 13 | % VOICEBOX is a MATLAB toolbox for speech processing. 14 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 15 | % 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % This program is free software; you can redistribute it and/or modify 18 | % it under the terms of the GNU General Public License as published by 19 | % the Free Software Foundation; either version 2 of the License, or 20 | % (at your option) any later version. 21 | % 22 | % This program is distributed in the hope that it will be useful, 23 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | % GNU General Public License for more details. 26 | % 27 | % You can obtain a copy of the GNU General Public License from 28 | % http://www.gnu.org/copyleft/gpl.html or by writing to 29 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | x=choosenk(n+k-1,k); 32 | x=x-repmat(0:k-1,size(x,1),1); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/dypsa.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/dypsa.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/erb2frq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/erb2frq.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/filtbankm.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/filtbankm.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/flac.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/flac.exe -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/frq2bark.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/frq2bark.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/frq2erb.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/frq2erb.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/frq2mel.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/frq2mel.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/gammabank.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/gammabank.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/gaussmixg.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/gaussmixg.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/gaussmixk.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/gaussmixk.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/glotlf.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/glotlf.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/gmmlpdf.m: -------------------------------------------------------------------------------- 1 | function l=gmmlpdf(varargin) 2 | %GMMLPDF obsolete function - please use GAUSSMIXP instead 3 | l=gaussmixp(varargin{1:nargin}); 4 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/hypergeom1f1.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/hypergeom1f1.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/importsii.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/importsii.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/kmeanlbg.m: -------------------------------------------------------------------------------- 1 | function [x,esq,j] = kmeanlbg(d,k) 2 | %KMEANLBG Vector quantisation using the Linde-Buzo-Gray algorithm [X,ESQ,J]=(D,K) 3 | % 4 | %Inputs: 5 | % D contains data vectors (one per row) 6 | % K is number of centres required 7 | % 8 | %Outputs: 9 | % X is output row vectors (K rows) 10 | % ESQ is mean square error 11 | % J indicates which centre each data vector belongs to 12 | % 13 | % Implements LBG K-means algorithm: 14 | % Linde, Y., A. Buzo, and R. M. Gray, 15 | % "An Algorithm for vector quantiser design," 16 | % IEEE Trans Communications, vol. 28, pp.84-95, Jan 1980. 17 | 18 | 19 | % Copyright (C) Mike Brookes 1998 20 | % Version: $Id: kmeanlbg.m 4497 2014-04-23 10:28:55Z dmb $ 21 | % 22 | % VOICEBOX is a MATLAB toolbox for speech processing. 23 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 24 | % 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % This program is free software; you can redistribute it and/or modify 27 | % it under the terms of the GNU General Public License as published by 28 | % the Free Software Foundation; either version 2 of the License, or 29 | % (at your option) any later version. 30 | % 31 | % This program is distributed in the hope that it will be useful, 32 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 33 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 34 | % GNU General Public License for more details. 35 | % 36 | % You can obtain a copy of the GNU General Public License from 37 | % http://www.gnu.org/copyleft/gpl.html or by writing to 38 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 39 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 40 | 41 | nc=size(d,2); 42 | [x,esq,j]=v_kmeans(d,1); 43 | m=1; 44 | while m1 37 | rr=lpcrf2rr(lpcar2rf(ar),p).*k(:,ones(1,p+1)); 38 | else 39 | rr=lpcrf2rr(lpcar2rf(ar)).*k(:,ones(1,size(ar,2))); 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcar2zz.m: -------------------------------------------------------------------------------- 1 | function zz=lpcar2zz(ar) 2 | %LPCAR2ZZ Convert ar filter to z-plane poles ZZ=(AR) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcar2zz.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | [nf,p1]=size(ar); 28 | zz=zeros(nf,p1-1); 29 | for k=1:nf 30 | zz(k,:)=roots(ar(k,:)).'; 31 | end 32 | 33 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcbwexp.m: -------------------------------------------------------------------------------- 1 | function arx=lpcbwexp(ar,bw) 2 | %LPCBWEXP expand formant bandwidths of LPC filter ARX=(AR,BW) 3 | %minimum bandwidth will be BW*fs where fs is the sampling frequency 4 | %the radius of each pole will be multiplied by R=exp(-BW*pi) 5 | % To set the maximum pole radius to R use BW=-log(R)/PI. 6 | 7 | 8 | 9 | % Copyright (C) Mike Brookes 1998 10 | % Version: $Id: lpcbwexp.m 713 2011-10-16 14:45:43Z dmb $ 11 | % 12 | % VOICEBOX is a MATLAB toolbox for speech processing. 13 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 14 | % 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % This program is free software; you can redistribute it and/or modify 17 | % it under the terms of the GNU General Public License as published by 18 | % the Free Software Foundation; either version 2 of the License, or 19 | % (at your option) any later version. 20 | % 21 | % This program is distributed in the hope that it will be useful, 22 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | % GNU General Public License for more details. 25 | % 26 | % You can obtain a copy of the GNU General Public License from 27 | % http://www.gnu.org/copyleft/gpl.html or by writing to 28 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | [nf,p1]=size(ar); 32 | k=exp(-pi*(0:p1-1)*bw); 33 | arx=ar.*k(ones(nf,1),:); 34 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpccc2ar.m: -------------------------------------------------------------------------------- 1 | function ar=lpccc2ar(cc) 2 | %LPCCC2AR Convert complex cepstrum to ar coefficients AR=(CC) 3 | % 4 | % MATLAB5 version 5 | 6 | 7 | % Copyright (C) Mike Brookes 1998 8 | % Version: $Id: lpccc2ar.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | [nf,p]=size(cc); 30 | rp=-(1:p); 31 | cc = cc .* rp(ones(nf,1),:); 32 | if p<2 33 | ar = [ones(nf,1) cc(:,1)]; 34 | else 35 | ar=zeros(nf,p+1); 36 | ar(:,1:3) = [ones(nf,1) cc(:,1) (cc(:,2)+cc(:,1).^2)/2]; 37 | for k=3:p 38 | ar(:,k+1) = (cc(:,k) + sum(cc(:,1:k-1).*ar(:,k:-1:2),2))/k; 39 | end 40 | end 41 | 42 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpccc2cc.m: -------------------------------------------------------------------------------- 1 | function c=lpccc2cc(cc,np) 2 | %LPCCC2PF Extrapolate complex cepstrum C=(CC) 3 | 4 | % Copyright (C) Mike Brookes 1998 5 | % Version: $Id: lpccc2cc.m 713 2011-10-16 14:45:43Z dmb $ 6 | % 7 | % VOICEBOX is a MATLAB toolbox for speech processing. 8 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 9 | % 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | % This program is free software; you can redistribute it and/or modify 12 | % it under the terms of the GNU General Public License as published by 13 | % the Free Software Foundation; either version 2 of the License, or 14 | % (at your option) any later version. 15 | % 16 | % This program is distributed in the hope that it will be useful, 17 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | % GNU General Public License for more details. 20 | % 21 | % You can obtain a copy of the GNU General Public License from 22 | % http://www.gnu.org/copyleft/gpl.html or by writing to 23 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | p=size(cc,2); 27 | if nargin<2 np=p; end 28 | if np<=p 29 | c=cc(:,1:np); 30 | else 31 | c=lpcar2cc(lpccc2ar(cc),np); 32 | end 33 | 34 | 35 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpccw2zz.m: -------------------------------------------------------------------------------- 1 | function zz=lpccw2zz(cw) 2 | %LPCPZ2ZZ LPC: Power spectrum roots to LPC poles ZZ=(CW) 3 | % pz are the roots of the power spectrum polynomial pp(cos(w)) 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % Version: $Id: lpccw2zz.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | zs=sqrt(cw.^2-1); 28 | zz=cw-sign(real(conj(cw).*zs)).*zs; 29 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcdb2pf.m: -------------------------------------------------------------------------------- 1 | function pf=lpcdb2pf(db) 2 | %LPCDB2PF Convert decibel power spectrum to power spectrum PF=(DB) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcdb2pf.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | pf=exp(db*log(10)/10); 28 | 29 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcdl2aa.m: -------------------------------------------------------------------------------- 1 | function aa=lpcdl2aa(dl) 2 | %LPCDL2AA dct of log area to area coefficients AA=(DL) 3 | 4 | % we do not correct for sinc errors 5 | 6 | 7 | % Copyright (C) Mike Brookes 1997 8 | % Version: $Id: lpcdl2aa.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | [nf,p]=size(dl); 30 | aa=[zeros(nf,1) exp(irdct(dl.').') ones(nf,1)]; 31 | 32 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcff2pf.m: -------------------------------------------------------------------------------- 1 | function pf=lpcff2pf(ff) 2 | %LPCFF2PF Convert complex spectrum to power spectrum PF=(FF) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcff2pf.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | pf=abs(ff).^2; 28 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcfq2zz.m: -------------------------------------------------------------------------------- 1 | function zz=lpcfq2zz(f,q) 2 | %LPCFQ2ZZ Convert frequencies and q factors to z-plane poles ZZ=(F,Q) 3 | %all input values are in normalized Hz 4 | % roots are at exp(2*pi*f*(-1/(2q) +- j) 5 | % if f has more columns than q, remaining columns are real roots at -f 6 | 7 | % Copyright (C) Mike Brookes 1998 8 | % Version: $Id: lpcfq2zz.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | [nf,pf]=size(f); 30 | if nargin < 2 31 | pq=0; 32 | else 33 | pq=size(q,2); 34 | end; 35 | zz=zeros(nf,pf+pq); 36 | if pq 37 | ii=1:pq; 38 | zz(:,2*ii-1)=exp(pi*f(:,ii).*(2i-q.^(-1))); 39 | zz(:,2*ii)=conj(zz(:,2*ii-1)); 40 | end 41 | if pf>pq 42 | ii=1+pq:pf; 43 | zz(:,ii+pq)= exp(-2*pi*f(:,ii)); 44 | end 45 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcim2ar.m: -------------------------------------------------------------------------------- 1 | function ar=lpcim2ar(im) 2 | %LPCIM2AR Convert impulse response to AR coefs AR=(IM) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcim2ar.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | [nf,p1]=size(im); 28 | ar=zeros(nf,p1); 29 | wz=[1 zeros(1,p1-1)]; 30 | for k=1:nf 31 | ar(k,:)=wz/toeplitz(wz,im(k,:)/im(k,1)); 32 | end 33 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcis2rf.m: -------------------------------------------------------------------------------- 1 | function rf=lpcis2rf(is) 2 | %LPCRF2IS Convert inverse sines to reflection coefficients RF=(IS) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcis2rf.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | rf=sin(is*pi/2); 28 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcla2rf.m: -------------------------------------------------------------------------------- 1 | function rf=lpcla2rf(la) 2 | %LPCLA2RF Convert log areas to reflection coefficients RF=(LA) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcla2rf.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | [nf,p2]=size(la); 28 | rf=-tanh((la(:,1:p2-1)-la(:,2:p2))/2); 29 | 30 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpclo2rf.m: -------------------------------------------------------------------------------- 1 | function rf=lpclo2rf(lo) 2 | %LPCLO2RF Convert log area ratios to reflection coefficients RF=(LO) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpclo2rf.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | rf=-tanh(lo/2); 28 | 29 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcls2ar.m: -------------------------------------------------------------------------------- 1 | function ar=lpcls2ar(ls) 2 | %LPCLS2AR convert line spectrum pair frequencies to ar polynomial AR=(LS) 3 | % input vector elements should be in the range 0 to 0.5 4 | 5 | 6 | % Copyright (C) Mike Brookes 1997 7 | % Version: $Id: lpcls2ar.m 713 2011-10-16 14:45:43Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | [nf,p]=size(ls); 29 | p1=p+1; 30 | p2 = p1*2; 31 | ar=zeros(nf,p1); 32 | for k=1:nf 33 | le=exp(ls(k,:)*pi*2i); 34 | lf=[1 le -1 conj(fliplr(le))]; 35 | y=real(poly(lf(1:2:p2))); 36 | x=real(poly(lf(2:2:p2))); 37 | ar(k,:)=(x(1:p1)+y(1:p1))/2; 38 | end 39 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcpf2rr.m: -------------------------------------------------------------------------------- 1 | function rr=lpcpf2rr(pf,p) 2 | %LPCPF2RR convert power spectrum to autocorrelation coefs RR=(PF,P) 3 | % Note that these will only be accurate if the power spectrum is much longer than p 4 | 5 | 6 | % Copyright (C) Mike Brookes 1997 7 | % Version: $Id: lpcpf2rr.m 2460 2012-10-29 22:20:45Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | [nf,p2]=size(pf); 29 | if nargin<2 p=p2-2; end; 30 | ir=irfft(pf,[],2); 31 | if p>p2-2 32 | rr=[ir(:,1:p2-1) zeros(nf,p+2-p2)]; 33 | else 34 | rr=ir(:,1:p+1); 35 | end 36 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcpp2cw.m: -------------------------------------------------------------------------------- 1 | function cw=lpcpp2cw(pp) 2 | %LPCPP2PZ LPC: Convert power spectrum polynomial in cos(w) to power spectrum zeros CW=(RP) 3 | % pp is a polynomial such that |polyval(ra,e^jw)| = polyval(pp,cos(w)) 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % Version: $Id: lpcpp2cw.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | [nf,p1]=size(pp); 28 | cw=zeros(nf,p1-1); 29 | for k=1:nf 30 | cw(k,:)=roots(pp(k,:)).'; 31 | end 32 | 33 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcpp2pz.m: -------------------------------------------------------------------------------- 1 | function pz=lpcpp2pz(pp) 2 | %LPCPP2PZ LPC: Convert power spectrum polynomial in cos(w) to power spectrum zeros PZ=(RP) 3 | % pp is a polynomial such that |polyval(ra,e^jw)| = polyval(pp,cos(w)) 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % Version: $Id: lpcpp2pz.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | pz=roots(pp); 28 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcpz2zz.m: -------------------------------------------------------------------------------- 1 | function zz=lpcpz2zz(pz) 2 | %LPCPZ2ZZ LPC: Power spectrum roots to LPC poles ZZ=(PZ) 3 | % pz are the roots of the power spectrum polynomial pp(cos(w)) 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % Version: $Id: lpcpz2zz.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | zs=sqrt(pz.^2-1); 28 | zz=pz-sign(real(conj(pz).*zs)).*zs; 29 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcra2ar.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/lpcra2ar.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcra2pf.m: -------------------------------------------------------------------------------- 1 | function pf=lpcra2pf(ra,np) 2 | %LPCAR2PF Convert AR coefs to power spectrum PF=(RA,NP) 3 | % The routine is faster if NP+1 is a power of 2 4 | % For RA(:,p+1) the default value of np is p and the output is PF(:,p+2) 5 | 6 | 7 | % Copyright (C) Mike Brookes 1997 8 | % Version: $Id: lpcra2pf.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | [nf,p1]=size(ra); 30 | if nargin<2 np=p1-1; end 31 | pp=2*np+2; 32 | if pp>=2*p1 33 | pf=abs(rfft([ra zeros(nf,pp-2*p1+1) ra(:,p1:-1:2)].').').^(-1); 34 | else 35 | pf=abs(rfft([ra(:,1:np+2) ra(:,np+1:-1:2)].').').^(-1); 36 | end 37 | 38 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcra2pp.m: -------------------------------------------------------------------------------- 1 | function pp=lpcra2pp(ra) 2 | %LPCAR2PP LPC: Convert ar filter autocorrelation to power spectrum polynomial in cos(w) PP=(RA) 3 | % pp is a polynomial such that |polyval(ra,e^jw)| = polyval(pp,cos(w)) 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % Version: $Id: lpcra2pp.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | persistent tp; 28 | [nf,p1]=size(ra); 29 | % we check here if p is the same as before and reuse the tp matrix 30 | if size(tp,1)~=p1 31 | p=p1-1; 32 | % chebyshev polynomials up to order p 33 | tp=zeros(p1,p1); 34 | tp(1,p1)=2; 35 | tp(2,p)=2; 36 | for i=3:p1 37 | tp(i,p+2-i:p)=2*tp(i-1,p+3-i:p1)-tp(i-2,p+2-i:p); 38 | tp(i,p1)=-tp(i-2,p1); 39 | end 40 | tp(1,p1)=1; 41 | end 42 | pp=ra*tp; 43 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrand.m: -------------------------------------------------------------------------------- 1 | function ar=lpcrand(p,n,bw) 2 | % generate n random stable polynomials of order p with a minimum pole 3 | % bandwidth of bw*fs where fs is the sampling fequency. 4 | % To limit the pole radius to r set bw=-log(r)/pi 5 | % bw may be a vector specifying a different max bandwidth for each row 6 | 7 | % Copyright (C) Mike Brookes 1997 8 | % Version: $Id: lpcrand.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | if nargin < 3 30 | bw=0; 31 | if nargin < 2 32 | n=1; 33 | end 34 | end 35 | if p 36 | if ~bw 37 | ar=lpcrf2ar(2*rand(n,p+1)-1); 38 | else 39 | k=exp(-pi*bw(:)*(0:p)); 40 | if size(k,1)==1 41 | ar=lpcrf2ar(2*rand(n,p+1)-1).*k(ones(n,1),:); 42 | else 43 | ar=lpcrf2ar(2*rand(n,p+1)-1).*k; 44 | end 45 | end 46 | else 47 | ar=ones(n,1); 48 | end 49 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrf2aa.m: -------------------------------------------------------------------------------- 1 | function aa=lpcrf2aa(rf) 2 | %LPCRF2AA Convert reflection coefficients to area function AA=(RF) 3 | %The areas are normalised so that aa(p+2)=1: the effective area of the free air beyond the lips. 4 | % aa(1) is the area of the glottis. This will be zero if rf(:,1)=1. 5 | 6 | 7 | % Copyright (C) Mike Brookes 1997 8 | % Version: $Id: lpcrf2aa.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | aa = fliplr(cumprod([ones(1,size(rf,1)); fliplr((1-rf)./(1+rf)).']).'); 30 | 31 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrf2ao.m: -------------------------------------------------------------------------------- 1 | function ao=lpcrf2ao(rf) 2 | %LPCRF2AO Convert reflection coefficients to area ratios AO=(RF) 3 | % ao(k) is the ratio between the k'th and the (k+1)'th segment 4 | 5 | 6 | % Copyright (C) Mike Brookes 1997 7 | % Version: $Id: lpcrf2ao.m 713 2011-10-16 14:45:43Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | ao =(1-rf)./(1+rf); 29 | 30 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrf2is.m: -------------------------------------------------------------------------------- 1 | function is=lpcrf2is(rf) 2 | %LPCRF2IS Convert reflection coefficients to inverse sines IS=(RF) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpcrf2is.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | is=asin(rf)*2/pi; 28 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrf2la.m: -------------------------------------------------------------------------------- 1 | function la=lpcrf2la(rf) 2 | %LPCRF2LA Convert reflection coefficients to log areas LA=(RF) 3 | % areas are normalised to give la(p+2)=0, the log area of the free space beyond lips 4 | 5 | 6 | % Copyright (C) Mike Brookes 1997 7 | % Version: $Id: lpcrf2la.m 713 2011-10-16 14:45:43Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | r=max(min(rf,1-1E-6),1E-6-1); 29 | lo=log((1-r)./(1+r)); 30 | la=fliplr([zeros(size(rf,1),1) cumsum(fliplr(log((1-r)./(1+r))).').']); 31 | 32 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrf2lo.m: -------------------------------------------------------------------------------- 1 | function lo=lpcrf2lo(rf) 2 | %LPCRF2LO Convert reflection coefficients to log area ratios LO=(RF) 3 | %the output values are limited to about +-14.5 4 | 5 | 6 | % Copyright (C) Mike Brookes 1997 7 | % Version: $Id: lpcrf2lo.m 713 2011-10-16 14:45:43Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | r=max(min(rf,1-1E-6),1E-6-1); 29 | lo=log((1-r)./(1+r)); 30 | 31 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcrr2ar.m: -------------------------------------------------------------------------------- 1 | function [ar,e]=lpcrr2ar(rr); 2 | %LPCRR2AR convert autocorrelation coefs to ar coefs [AR,E]=(RR) 3 | %E is the residual energy 4 | 5 | % could test e each time and remove rows when it gets small 6 | 7 | 8 | % Copyright (C) Mike Brookes 1997 9 | % Version: $Id: lpcrr2ar.m 713 2011-10-16 14:45:43Z dmb $ 10 | % 11 | % VOICEBOX is a MATLAB toolbox for speech processing. 12 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 13 | % 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % This program is free software; you can redistribute it and/or modify 16 | % it under the terms of the GNU General Public License as published by 17 | % the Free Software Foundation; either version 2 of the License, or 18 | % (at your option) any later version. 19 | % 20 | % This program is distributed in the hope that it will be useful, 21 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | % GNU General Public License for more details. 24 | % 25 | % You can obtain a copy of the GNU General Public License from 26 | % http://www.gnu.org/copyleft/gpl.html or by writing to 27 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | 30 | [nf,p1]=size(rr); 31 | p=p1-1; 32 | ar=ones(nf,p1); 33 | ar(:,2) = -rr(:,2)./rr(:,1); 34 | e = rr(:,1).*(ar(:,2).^2-1); 35 | for n = 2:p 36 | k = (rr(:,n+1)+sum(rr(:,n:-1:2).*ar(:,2:n),2)) ./ e; 37 | ar(:,2:n) = ar(:,2:n)+k(:,ones(1,n-1)).*ar(:,n:-1:2); 38 | ar(:,n+1) = k; 39 | e = e.*(1-k.^2); 40 | end 41 | e=-e; 42 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpcss2zz.m: -------------------------------------------------------------------------------- 1 | function zz=lpcss2zz(ss) 2 | %LPCSS2ZZ Convert s-place poles to z-plane poles ZZ=(SS) 3 | %the s-plane is in units of Normalized Hz and so the imaginary part 4 | % of each ss() value is in the range +-0.5 5 | % 6 | % If you multiply ss by the sample frequency, a formant with 7 | % frequency f and bandwidth b will give an s-plane pole-pair 8 | % of approximately -b/2 +- j f 9 | 10 | % Copyright (C) Mike Brookes 1997 11 | % Version: $Id: lpcss2zz.m 8210 2016-07-20 20:58:39Z dmb $ 12 | % 13 | % VOICEBOX is a MATLAB toolbox for speech processing. 14 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 15 | % 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % This program is free software; you can redistribute it and/or modify 18 | % it under the terms of the GNU General Public License as published by 19 | % the Free Software Foundation; either version 2 of the License, or 20 | % (at your option) any later version. 21 | % 22 | % This program is distributed in the hope that it will be useful, 23 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | % GNU General Public License for more details. 26 | % 27 | % You can obtain a copy of the GNU General Public License from 28 | % http://www.gnu.org/copyleft/gpl.html or by writing to 29 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | 32 | zz=exp(2*pi*ss); 33 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpczz2ar.m: -------------------------------------------------------------------------------- 1 | function ar=lpczz2ar(zz) 2 | %LPCZZ2AR Convert z-place poles to ar coefficients AR=(ZZ) 3 | % The complex poles must occur in complex conjugate pairs 4 | % but the order is unimportant. 5 | 6 | 7 | % Copyright (C) Mike Brookes 1997 8 | % Version: $Id: lpczz2ar.m 713 2011-10-16 14:45:43Z dmb $ 9 | % 10 | % VOICEBOX is a MATLAB toolbox for speech processing. 11 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 12 | % 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % This program is free software; you can redistribute it and/or modify 15 | % it under the terms of the GNU General Public License as published by 16 | % the Free Software Foundation; either version 2 of the License, or 17 | % (at your option) any later version. 18 | % 19 | % This program is distributed in the hope that it will be useful, 20 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | % GNU General Public License for more details. 23 | % 24 | % You can obtain a copy of the GNU General Public License from 25 | % http://www.gnu.org/copyleft/gpl.html or by writing to 26 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | [nf,p]=size(zz); 30 | ar=zeros(nf,p+1); 31 | for k=1:nf 32 | ar(k,:)=real(poly(zz(k,:))); 33 | end 34 | 35 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpczz2cc.m: -------------------------------------------------------------------------------- 1 | function cc=lpczz2cc(zz,np) 2 | %LPCZZ2CC Convert poles to "complex" cepstrum CC=(ZZ,NP) 3 | 4 | 5 | % Copyright (C) Mike Brookes 1997 6 | % Version: $Id: lpczz2cc.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | [nf,p]=size(zz); 28 | if (nargin < 2) np=p; end 29 | cc=zeros(nf,np); 30 | yy=zz.'; 31 | if p<2 % special case 'cos sum() is weird 32 | cc(:,1)=real(zz); 33 | for k=2:np 34 | yy=yy.*zz.'; 35 | cc(:,k)=real(yy).'/k; 36 | end 37 | else 38 | cc(:,1)=sum(real(yy)).'; 39 | for k=2:np 40 | yy=yy.*zz.'; 41 | cc(:,k)=sum(real(yy)).'/k; 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/lpczz2ss.m: -------------------------------------------------------------------------------- 1 | function ss=lpczz2ss(zz) 2 | %LPCZZ2SS Convert z-place poles to s-plane poles SS=(ZZ) 3 | %the s-plane is in units of Normalized Hz and so the imaginary part 4 | % of each ss() value is in the range +-0.5 5 | % 6 | % If you multiply ss by the sample frequency, a formant with 7 | % frequency f and bandwidth b will give an s-plane pole-pair 8 | % of approximately -b/2 +- j f 9 | 10 | 11 | % Copyright (C) Mike Brookes 1997 12 | % Version: $Id: lpczz2ss.m 713 2011-10-16 14:45:43Z dmb $ 13 | % 14 | % VOICEBOX is a MATLAB toolbox for speech processing. 15 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 16 | % 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % This program is free software; you can redistribute it and/or modify 19 | % it under the terms of the GNU General Public License as published by 20 | % the Free Software Foundation; either version 2 of the License, or 21 | % (at your option) any later version. 22 | % 23 | % This program is distributed in the hope that it will be useful, 24 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | % GNU General Public License for more details. 27 | % 28 | % You can obtain a copy of the GNU General Public License from 29 | % http://www.gnu.org/copyleft/gpl.html or by writing to 30 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | 33 | ss=log(max(zz,1e-8))*0.5/pi; 34 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/m2htmlpwd.m: -------------------------------------------------------------------------------- 1 | %M2HTMLPWD - create html documentation of files in current directory 2 | % 3 | % M2HTML must be on the matlab path 4 | % available from http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4039&objectType=FILE 5 | 6 | % Copyright (C) Mike Brookes 1998 7 | % Version: $Id: m2htmlpwd.m 713 2011-10-16 14:45:43Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | pd=pwd; 29 | tl=pd(max([find(pd=='\') find(pd=='/')])+1:end); 30 | cd('..'); 31 | m2html('mfiles',tl,'htmldir',[tl '\doc']); 32 | cd(pd); 33 | winopen(['doc\' tl '\index.html']); 34 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/maxgauss.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/maxgauss.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/mel2frq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/mel2frq.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/melbankm.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/melbankm.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/mintrace.m: -------------------------------------------------------------------------------- 1 | function p=mintrace(x) 2 | %MINTRACE find row permutation to minimize the trace p=(x) 3 | %Inputs: x(n,n) is a square real-valued matrix 4 | % 5 | %Outputs: p(n,1) is the row permutation that minimizes the trace 6 | % so that trace(x(p,:)) is as small as possible 7 | 8 | % Copyright (C) Mike Brookes 2012-2013 9 | % Version: $Id: mintrace.m 2718 2013-02-23 09:34:45Z dmb $ 10 | % 11 | % VOICEBOX is a MATLAB toolbox for speech processing. 12 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 13 | % 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % This program is free software; you can redistribute it and/or modify 16 | % it under the terms of the GNU General Public License as published by 17 | % the Free Software Foundation; either version 2 of the License, or 18 | % (at your option) any later version. 19 | % 20 | % This program is distributed in the hope that it will be useful, 21 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | % GNU General Public License for more details. 24 | % 25 | % You can obtain a copy of the GNU General Public License from 26 | % http://www.gnu.org/copyleft/gpl.html or by writing to 27 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | n=size(x,1); % input x must be square 30 | p=permutes(n); % try all permutations 31 | c=0:n:n^2-1; % convert olumns to single indexing 32 | [v,i]=min(sum(x(p+c(ones(length(p),1),:)),2)); 33 | p=p(i,:)'; 34 | 35 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/modspect.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/modspect.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/peak2dquad.m: -------------------------------------------------------------------------------- 1 | function [v,xy,t,m]=peak2dquad(z) 2 | %PEAK2DQUAD find quadratically-interpolated peak in a 2D array 3 | % 4 | % Note: This routine has been superceeded by quadpeak 5 | % 6 | % Inputs: Z(m,n) is the input array 7 | % 8 | % Outputs: V is the peak value 9 | % XY(2,1) is the position of the peak (in fractional subscript values) 10 | % T is -1, 0, +1 for maximum, saddle point or minimum 11 | % M defines the fitted quadratic: z = [x y 1]*M*[x y 1]' 12 | 13 | % Copyright (C) Mike Brookes 2008 14 | % Version: $Id: peak2dquad.m 713 2011-10-16 14:45:43Z dmb $ 15 | % 16 | % VOICEBOX is a MATLAB toolbox for speech processing. 17 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 18 | % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % This program is free software; you can redistribute it and/or modify 21 | % it under the terms of the GNU General Public License as published by 22 | % the Free Software Foundation; either version 2 of the License, or 23 | % (at your option) any later version. 24 | % 25 | % This program is distributed in the hope that it will be useful, 26 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | % GNU General Public License for more details. 29 | % 30 | % You can obtain a copy of the GNU General Public License from 31 | % http://www.gnu.org/copyleft/gpl.html or by writing to 32 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | 35 | [v,xy,t,m]=quadpeak(z); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/permutes.m: -------------------------------------------------------------------------------- 1 | function [p,s]=permutes(n) 2 | %PERMUTES All N! permutations of 1:N + signatures [P,S]=(N) 3 | % The output P is a matrix of size (N!,N) where each row 4 | % contains a permutation of the numbers 1:N. The rows are in 5 | % lexically sorted order. 6 | % 7 | % To permute the elements of an arbitrary vector V use 8 | % V(PERMUTES(LENGTH(V))). 9 | 10 | % PERMUTES(N) is the same as SORTROWS(PERMS(1:N)) but much faster. 11 | 12 | % Thanks to Peter J Acklam for several improvements. 13 | 14 | % Copyright (c) 1998 Mike Brookes, mike.brookes@ic.ac.uk 15 | % Version: $Id: permutes.m 713 2011-10-16 14:45:43Z dmb $ 16 | % 17 | % VOICEBOX is a MATLAB toolbox for speech processing. 18 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 19 | % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % This program is free software; you can redistribute it and/or modify 22 | % it under the terms of the GNU General Public License as published by 23 | % the Free Software Foundation; either version 2 of the License, or 24 | % (at your option) any later version. 25 | % 26 | % This program is distributed in the hope that it will be useful, 27 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | % GNU General Public License for more details. 30 | % 31 | % You can obtain a copy of the GNU General Public License from 32 | % http://www.gnu.org/copyleft/gpl.html or by writing to 33 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | 36 | p=1; 37 | m=1; 38 | if n>1 39 | for a=2:n 40 | q=zeros(a*m,a); 41 | r=2:a+1; 42 | ix=1:m; 43 | for b=1:a 44 | q(ix,1)=b; 45 | q(ix,2:a)=r(p); 46 | r(b)=b; 47 | ix=ix+m; 48 | end 49 | m=m*a; 50 | p=q; 51 | end 52 | end 53 | if nargout>1 s=1-2*rem(fix((1:m)'/2),2); end 54 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/phon2sone.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/phon2sone.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/polygonarea.m: -------------------------------------------------------------------------------- 1 | function a=polygonarea(p) 2 | %POLYGONAREA Calculate the area of a polygon 3 | % 4 | % Inputs: 5 | % P(n,2) is the polygon vertices 6 | % 7 | % Outputs: 8 | % A is teh area of teh polygon 9 | % 10 | % The area is positive if the vertices go anti-clockwise around the polygon. 11 | % 12 | 13 | % Copyright (C) Mike Brookes 2009 14 | % Version: $Id: polygonarea.m 713 2011-10-16 14:45:43Z dmb $ 15 | % 16 | % VOICEBOX is a MATLAB toolbox for speech processing. 17 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 18 | % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % This program is free software; you can redistribute it and/or modify 21 | % it under the terms of the GNU General Public License as published by 22 | % the Free Software Foundation; either version 2 of the License, or 23 | % (at your option) any later version. 24 | % 25 | % This program is distributed in the hope that it will be useful, 26 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | % GNU General Public License for more details. 29 | % 30 | % You can obtain a copy of the GNU General Public License from 31 | % http://www.gnu.org/copyleft/gpl.html or by writing to 32 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | p(end+1,:)=p(1,:); % append an extra point 35 | a=0.5*sum((p(1:end-1,1)-p(2:end,1)).*(p(1:end-1,2)+p(2:end,2)),1); 36 | if ~nargout 37 | plot(p(:,1),p(:,2),'b-'); 38 | mnx=[1.05 -0.05;-0.05 1.05]*[min(p);max(p)]; 39 | set(gca,'xlim',mnx(:,1)','ylim',mnx(:,2)'); 40 | title(sprintf('Area = %.2g',a)); 41 | end 42 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/prob2berk.m: -------------------------------------------------------------------------------- 1 | function [b,d]=prob2berk(p) 2 | %PROB2BERK convert probability to Berksons 3 | % 4 | % Inputs: P(M,N) matrix containing probability values 5 | % 6 | % Outputs: P(M,N) Corresponding Berkson values 7 | % D(M,N) Corresponding derivatives dP/dB 8 | % 9 | % Berksons, or log-odds, are a nonlinear scale for measuring 10 | % probability defined by B = log2(P./(1-P)). 11 | % When Berksons are used to measure probability, a logistic 12 | % psychometric function becomes linear. 13 | % 14 | % The inverse function is berk2prob() 15 | 16 | % Copyright (C) Mike Brookes 2014 17 | % Version: $Id: prob2berk.m 4501 2014-04-24 06:28:21Z dmb $ 18 | % 19 | % VOICEBOX is a MATLAB toolbox for speech processing. 20 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 21 | % 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % This program is free software; you can redistribute it and/or modify 24 | % it under the terms of the GNU General Public License as published by 25 | % the Free Software Foundation; either version 2 of the License, or 26 | % (at your option) any later version. 27 | % 28 | % This program is distributed in the hope that it will be useful, 29 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | % GNU General Public License for more details. 32 | % 33 | % You can obtain a copy of the GNU General Public License from 34 | % http://www.gnu.org/copyleft/gpl.html or by writing to 35 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | b=log2(p./(1-p)); 38 | if nargout>1 39 | d=log(2)*p.*(1-p); 40 | end 41 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/qrabs.m: -------------------------------------------------------------------------------- 1 | function [m,q]=qrabs(q1) 2 | %QRABS absolute value and normalization of a real quaternions [m,q]=[q1] 3 | % 4 | % Inputs: q1(4n,...) A real quaternion array. Each quaternion is a column 5 | % vector of the form [r, i, j, k]' 6 | % 7 | % Outputs: m(n,...) Array of quaternion magnitudes: m=sqrt(q'*q) 8 | % q(4n,...) Normalized version of q1 with unit magnitude 9 | % a zero quaternion is normalized to [1 0 0 0]' 10 | 11 | % Copyright (C) Mike Brookes 2000-2012 12 | % Version: $Id: qrabs.m 1645 2012-03-16 17:00:15Z dmb $ 13 | % 14 | % VOICEBOX is a MATLAB toolbox for speech processing. 15 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 16 | % 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % This program is free software; you can redistribute it and/or modify 19 | % it under the terms of the GNU General Public License as published by 20 | % the Free Software Foundation; either version 2 of the License, or 21 | % (at your option) any later version. 22 | % 23 | % This program is distributed in the hope that it will be useful, 24 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | % GNU General Public License for more details. 27 | % 28 | % You can obtain a copy of the GNU General Public License from 29 | % http://www.gnu.org/copyleft/gpl.html or by writing to 30 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | q1=randn(8,3); 33 | q1(9:12)=0; 34 | s=size(q1); 35 | q=reshape(q1,4,[]); 36 | m=sqrt(sum(q.^2,1)); 37 | q(:,m>0)=q(:,m>0)./m(ones(4,1),m>0); 38 | q(1,m<=0)=1; 39 | q=reshape(q,s); 40 | s(1)=s(1)/4; 41 | m=reshape(m,s); 42 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/qrdotmult.m: -------------------------------------------------------------------------------- 1 | function q=qrdotmult(q1,q2) 2 | %QRDOTMULT multiplies together two real quaternions arrays q=[q1,q2] 3 | % 4 | % Inputs: q1(4n,...) 5 | % q2(4n,...) Two real quaternion arrays of equal size 6 | % 7 | % Outputs: q(4n,...) The Hadamard product (i.e. .*) of the input arrays 8 | % 9 | % Copyright (C) Mike Brookes 2000-2012 10 | % Version: $Id: qrdotmult.m 1618 2012-03-15 09:14:33Z dmb $ 11 | % 12 | % VOICEBOX is a MATLAB toolbox for speech processing. 13 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 14 | % 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % This program is free software; you can redistribute it and/or modify 17 | % it under the terms of the GNU General Public License as published by 18 | % the Free Software Foundation; either version 2 of the License, or 19 | % (at your option) any later version. 20 | % 21 | % This program is distributed in the hope that it will be useful, 22 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | % GNU General Public License for more details. 25 | % 26 | % You can obtain a copy of the GNU General Public License from 27 | % http://www.gnu.org/copyleft/gpl.html or by writing to 28 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | persistent a b c 31 | if isempty(a) 32 | a=[1 2 3 4 2 1 4 3 3 4 1 2 4 3 2 1]; 33 | b=[1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4]; 34 | c=[2 3 4 7 12 14]; 35 | end 36 | s=size(q1); 37 | qa=reshape(q1,4,[]); 38 | qb=reshape(q2,4,[]); 39 | q=qa(a,:).*qb(b,:); 40 | q(c,:)=-q(c,:); 41 | q=reshape(sum(reshape(q,4,[]),1),s); 42 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/qrmult.m: -------------------------------------------------------------------------------- 1 | function q=qrmult(q1,q2) 2 | %QRMULT multiplies together two real quaternions matrices q=[q1,q2] 3 | % 4 | % Inputs: q1(4m,n) Two real quaternions arrays. Either array can 5 | % q2(4n,r) also be a scalar quaternion. 6 | % 7 | % Outputs: q(4m,r) Matrix product of q1 and q2 8 | 9 | % Copyright (C) Mike Brookes 2000-2012 10 | % Version: $Id: qrmult.m 1617 2012-03-15 09:14:01Z dmb $ 11 | % 12 | % VOICEBOX is a MATLAB toolbox for speech processing. 13 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 14 | % 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % This program is free software; you can redistribute it and/or modify 17 | % it under the terms of the GNU General Public License as published by 18 | % the Free Software Foundation; either version 2 of the License, or 19 | % (at your option) any later version. 20 | % 21 | % This program is distributed in the hope that it will be useful, 22 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | % GNU General Public License for more details. 25 | % 26 | % You can obtain a copy of the GNU General Public License from 27 | % http://www.gnu.org/copyleft/gpl.html or by writing to 28 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | s1=size(q1); 31 | s2=size(q2); 32 | if isequal(s1,[4 1]) 33 | q=qrdotmult(repmat(q1,s2(1)/4,s2(2)),q2); 34 | elseif isequal(s2,[4 1]) 35 | q=qrdotmult(q1,repmat(q2,s1(1)/4,s1(2))); 36 | else 37 | q=rotqr2mr(q1)*q2; 38 | end 39 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/qrpermute.m: -------------------------------------------------------------------------------- 1 | function y=qrpermute(x,p) 2 | %QRPERMUTE transpose or permute a quaternion array y=[x,p] 3 | % 4 | % Inputs: x(4m,...) Real quaternions array 5 | % p new order of dimensions [default [2 1 ...] 6 | % 7 | % Outputs: y(4n,...) output real quaternion array 8 | 9 | % Copyright (C) Mike Brookes 2012 10 | % Version: $Id: qrpermute.m 1619 2012-03-15 09:31:31Z dmb $ 11 | % 12 | % VOICEBOX is a MATLAB toolbox for speech processing. 13 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 14 | % 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % This program is free software; you can redistribute it and/or modify 17 | % it under the terms of the GNU General Public License as published by 18 | % the Free Software Foundation; either version 2 of the License, or 19 | % (at your option) any later version. 20 | % 21 | % This program is distributed in the hope that it will be useful, 22 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | % GNU General Public License for more details. 25 | % 26 | % You can obtain a copy of the GNU General Public License from 27 | % http://www.gnu.org/copyleft/gpl.html or by writing to 28 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | s=size(x); 31 | if nargin<2 32 | p=[2 1 3:length(s)]; 33 | end 34 | s(1)=s(1)/4; 35 | t=s(p); 36 | t(1)=4*t(1); 37 | y=reshape(permute(reshape(x,[4 s]),[1 p+1]),t); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/readwav.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/readwav.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rectifyhomog.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/rectifyhomog.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rfft.m: -------------------------------------------------------------------------------- 1 | function y=rfft(x,n,d) 2 | %RFFT Calculate the DFT of real data Y=(X,N,D) 3 | % Data is truncated/padded to length N if specified. 4 | % N even: (N+2)/2 points are returned with 5 | % the first and last being real 6 | % N odd: (N+1)/2 points are returned with the 7 | % first being real 8 | % In all cases fix(1+N/2) points are returned 9 | % D is the dimension along which to do the DFT 10 | 11 | 12 | 13 | % Copyright (C) Mike Brookes 1998 14 | % Version: $Id: rfft.m 713 2011-10-16 14:45:43Z dmb $ 15 | % 16 | % VOICEBOX is a MATLAB toolbox for speech processing. 17 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 18 | % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % This program is free software; you can redistribute it and/or modify 21 | % it under the terms of the GNU General Public License as published by 22 | % the Free Software Foundation; either version 2 of the License, or 23 | % (at your option) any later version. 24 | % 25 | % This program is distributed in the hope that it will be useful, 26 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | % GNU General Public License for more details. 29 | % 30 | % You can obtain a copy of the GNU General Public License from 31 | % http://www.gnu.org/copyleft/gpl.html or by writing to 32 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | 35 | s=size(x); 36 | if prod(s)==1 37 | y=x 38 | else 39 | if nargin <3 || isempty(d) 40 | d=find(s>1,1); 41 | if nargin<2 42 | n=s(d); 43 | end 44 | end 45 | if isempty(n) 46 | n=s(d); 47 | end 48 | y=fft(x,n,d); 49 | y=reshape(y,prod(s(1:d-1)),n,prod(s(d+1:end))); 50 | s(d)=1+fix(n/2); 51 | y(:,s(d)+1:end,:)=[]; 52 | y=reshape(y,s); 53 | end 54 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rhartley.m: -------------------------------------------------------------------------------- 1 | function y=rhartley(x,n) 2 | %RHARTLEY Calculate the Hartley transform of real data Y=(X,N) 3 | % Data is truncated/padded to length N if specified. 4 | % The inverse transformation is x=hartley(y,n)/n 5 | 6 | % Copyright (C) Mike Brookes 1998 7 | % Version: $Id: rhartley.m 713 2011-10-16 14:45:43Z dmb $ 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. 10 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | % This program is free software; you can redistribute it and/or modify 14 | % it under the terms of the GNU General Public License as published by 15 | % the Free Software Foundation; either version 2 of the License, or 16 | % (at your option) any later version. 17 | % 18 | % This program is distributed in the hope that it will be useful, 19 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | % GNU General Public License for more details. 22 | % 23 | % You can obtain a copy of the GNU General Public License from 24 | % http://www.gnu.org/copyleft/gpl.html or by writing to 25 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | if nargin < 2 29 | y=fft(real(x)); 30 | else 31 | y=fft(real(x),n); 32 | end 33 | y=real(y)-imag(y); 34 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rnsubset.m: -------------------------------------------------------------------------------- 1 | function m = rnsubset(k,n) 2 | %RNSUBSET choose k distinct random integers from 1:n M=(K,N) 3 | % 4 | % Inputs: 5 | % 6 | % K is number of disinct integers required from the range 1:N 7 | % N specifies the range - we must have K<=N 8 | % 9 | % Outputs: 10 | % 11 | % M(1,K) contains the output numbers 12 | 13 | % Copyright (C) Mike Brookes 2006 14 | % Version: $Id: rnsubset.m 713 2011-10-16 14:45:43Z dmb $ 15 | % 16 | % VOICEBOX is a MATLAB toolbox for speech processing. 17 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 18 | % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % This program is free software; you can redistribute it and/or modify 21 | % it under the terms of the GNU General Public License as published by 22 | % the Free Software Foundation; either version 2 of the License, or 23 | % (at your option) any later version. 24 | % 25 | % This program is distributed in the hope that it will be useful, 26 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | % GNU General Public License for more details. 29 | % 30 | % You can obtain a copy of the GNU General Public License from 31 | % http://www.gnu.org/copyleft/gpl.html or by writing to 32 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | if k>n 35 | error('rnsubset: k must be <= n'); 36 | end 37 | % We use two algorithms according to the values of k and n 38 | [f,e]=log2(n); 39 | if k>0.03*n*(e-1) 40 | [v,m]=sort(rand(1,n)); % for large k, just do a random permutation 41 | else 42 | v=ceil(rand(1,k).*(n:-1:n-k+1)); 43 | m=1:n; 44 | for i=1:k 45 | j=v(i)+i-1; 46 | x=m(i); 47 | m(i)=m(j); 48 | m(j)=x; 49 | end 50 | end 51 | m=m(1:k); 52 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotax2qr.m: -------------------------------------------------------------------------------- 1 | function q=rotax2qr(a,t) 2 | %ROTQR2AX converts a rotation axis and angle to the corresponding real quaternion 3 | % Inputs: 4 | % 5 | % A(3,1) Vector in the direction of the rotation axis. 6 | % T Rotation angle in radians 7 | % 8 | % Output: 9 | % 10 | % Q(4,1) normalized real-valued quaternion 11 | % 12 | % In the quaternion representation of a rotation, and q(1) = cos(t/2) 13 | % where t is the angle of rotation and q(2:4)/sin(t/2) is a unit vector 14 | % lying along the axis of rotation. 15 | % A positive rotation about [0 0 1] takes the X axis towards the Y axis. 16 | % 17 | % Copyright (C) Mike Brookes 2007-2012 18 | % Version: $Id: rotax2qr.m 2177 2012-07-13 14:23:47Z dmb $ 19 | % 20 | % VOICEBOX is a MATLAB toolbox for speech processing. 21 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 22 | % 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % This program is free software; you can redistribute it and/or modify 25 | % it under the terms of the GNU General Public License as published by 26 | % the Free Software Foundation; either version 2 of the License, or 27 | % (at your option) any later version. 28 | % 29 | % This program is distributed in the hope that it will be useful, 30 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 31 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 32 | % GNU General Public License for more details. 33 | % 34 | % You can obtain a copy of the GNU General Public License from 35 | % http://www.gnu.org/copyleft/gpl.html or by writing to 36 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 37 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 38 | if all(a==0) 39 | a=[1;0;0]; 40 | end 41 | m=sqrt(a(:)'*a(:)); 42 | q=[cos(0.5*t); sin(0.5*t)*a(:)/m]; 43 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotmc2qc.m: -------------------------------------------------------------------------------- 1 | function qc=rotmc2qc(mc) 2 | %ROTMC2QC converts a matrix of complex quaternion matrices to a matrix of complex quaternion vectors 3 | % Inputs: 4 | % 5 | % MC(2m,2n) mxn matrix of real quaternion matrices (each 2x2) 6 | % 7 | % Outputs: 8 | % 9 | % QC(2m,n) mxn matrix of real quaternion vectors (each 2x1) 10 | % 11 | % In matrix form, quaternions can be multiplied and added using normal matrix 12 | % arithmetic. Each element of an mxn matrix of quaternions is itself a 2x2 block 13 | % so the total dimension of MC is 2m x 2n. 14 | 15 | % 16 | % Copyright (C) Mike Brookes 2000-2006 17 | % Version: $Id: rotmc2qc.m 713 2011-10-16 14:45:43Z dmb $ 18 | % 19 | % VOICEBOX is a MATLAB toolbox for speech processing. 20 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 21 | % 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % This program is free software; you can redistribute it and/or modify 24 | % it under the terms of the GNU General Public License as published by 25 | % the Free Software Foundation; either version 2 of the License, or 26 | % (at your option) any later version. 27 | % 28 | % This program is distributed in the hope that it will be useful, 29 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | % GNU General Public License for more details. 32 | % 33 | % You can obtain a copy of the GNU General Public License from 34 | % http://www.gnu.org/copyleft/gpl.html or by writing to 35 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | qc=mc(:,1:2:end); 38 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotmr2qr.m: -------------------------------------------------------------------------------- 1 | function qr=rotmr2qr(mr) 2 | %ROTMR2QR converts a matrix of real quaternion matrices to quaternion vectors 3 | % Inputs: 4 | % 5 | % MR(4m,4n) mxn matrix of real quaternion matrices (each 4x4) 6 | % 7 | % Outputs: 8 | % 9 | % QR(4m,n) mxn matrix of real quaternion vectors (each 4x1) 10 | % 11 | % In matrix form, quaternions can be multiplied and added using normal matrix 12 | % arithmetic. Each element of an mxn matrix of quaternions is itself a 4x4 block 13 | % so the total dimension of MR is 4m x 4n. 14 | 15 | % 16 | % Copyright (C) Mike Brookes 2000-2006 17 | % Version: $Id: rotmr2qr.m 713 2011-10-16 14:45:43Z dmb $ 18 | % 19 | % VOICEBOX is a MATLAB toolbox for speech processing. 20 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 21 | % 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % This program is free software; you can redistribute it and/or modify 24 | % it under the terms of the GNU General Public License as published by 25 | % the Free Software Foundation; either version 2 of the License, or 26 | % (at your option) any later version. 27 | % 28 | % This program is distributed in the hope that it will be useful, 29 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | % GNU General Public License for more details. 32 | % 33 | % You can obtain a copy of the GNU General Public License from 34 | % http://www.gnu.org/copyleft/gpl.html or by writing to 35 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | qr=mr(:,1:4:end); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotqc2qr.m: -------------------------------------------------------------------------------- 1 | function qr=rotqc2qr(qc) 2 | %ROTQC2QR converts a matrix of complex quaternion row vectors into real form 3 | % 4 | % Inputs: 5 | % 6 | % QC(2m,n) mxn matrix of complex-valued quaternions 7 | % 8 | % Outputs: 9 | % 10 | % QR(4m,n) mxn matrix of real-valued quaternions 11 | % 12 | % The complex-valued quaternion [r+j*b a+j*c] becomes [r a b c] 13 | 14 | % 15 | % Copyright (C) Mike Brookes 2000-2006 16 | % Version: $Id: rotqc2qr.m 713 2011-10-16 14:45:43Z dmb $ 17 | % 18 | % VOICEBOX is a MATLAB toolbox for speech processing. 19 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % This program is free software; you can redistribute it and/or modify 23 | % it under the terms of the GNU General Public License as published by 24 | % the Free Software Foundation; either version 2 of the License, or 25 | % (at your option) any later version. 26 | % 27 | % This program is distributed in the hope that it will be useful, 28 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | % GNU General Public License for more details. 31 | % 32 | % You can obtain a copy of the GNU General Public License from 33 | % http://www.gnu.org/copyleft/gpl.html or by writing to 34 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 35 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 | [m,n]=size(qc); 37 | i=(1:2:2*m)-mod(0:m-1,2); 38 | qr=zeros(2*m,n); 39 | qr(i,:)=real(qc); 40 | qr(i+2,:)=imag(qc); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotqr2ax.m: -------------------------------------------------------------------------------- 1 | function [a,t]=rotqr2ax(q) 2 | %ROTQR2AX converts a real quaternion to the corresponding rotation axis and angle 3 | % Inputs: 4 | % 5 | % Q(4,1) real-valued quaternion (with magnitude = 1) 6 | % 7 | % Outputs: 8 | % 9 | % A(3,1) Unit vector in the direction of the rotation axis. 10 | % T Rotation angle in radians (in range 0 to 2pi) 11 | % 12 | % In the quaternion representation of a rotation, and q(1) = cos(t/2) 13 | % where t is the angle of rotation in the range 0 to 2pi 14 | % and q(2:4)/sin(t/2) is a unit vector lying along the axis of rotation 15 | % a positive rotation about [0 0 1] takes the X axis towards the Y axis. 16 | % 17 | % Copyright (C) Mike Brookes 2007 18 | % Version: $Id: rotqr2ax.m 713 2011-10-16 14:45:43Z dmb $ 19 | % 20 | % VOICEBOX is a MATLAB toolbox for speech processing. 21 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 22 | % 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % This program is free software; you can redistribute it and/or modify 25 | % it under the terms of the GNU General Public License as published by 26 | % the Free Software Foundation; either version 2 of the License, or 27 | % (at your option) any later version. 28 | % 29 | % This program is distributed in the hope that it will be useful, 30 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 31 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 32 | % GNU General Public License for more details. 33 | % 34 | % You can obtain a copy of the GNU General Public License from 35 | % http://www.gnu.org/copyleft/gpl.html or by writing to 36 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 37 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 38 | a=q(2:4); 39 | m=sqrt(a'*a); 40 | t=2*atan2(m,q(1)); % avoids problems if unnormalized 41 | if m>0 42 | a=a/m; 43 | else 44 | a=[0 0 1]'; 45 | end 46 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotqr2qc.m: -------------------------------------------------------------------------------- 1 | function qc=rotqr2qc(qr) 2 | %ROTQR2QC converts a matrix of real quaternion vectors into complex form 3 | % 4 | % Inputs: 5 | % 6 | % QR(4m,...) array of real-valued quaternions 7 | % 8 | % Outputs: 9 | % 10 | % QC(2m,...) array of complex-valued quaternions 11 | % 12 | % The real-valued quaternion [r a b c]' becomes [r+j*b a+j*c]' 13 | 14 | % 15 | % Copyright (C) Mike Brookes 2000-2012 16 | % Version: $Id: rotqr2qc.m 1616 2012-03-15 09:13:31Z dmb $ 17 | % 18 | % VOICEBOX is a MATLAB toolbox for speech processing. 19 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 20 | % 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % This program is free software; you can redistribute it and/or modify 23 | % it under the terms of the GNU General Public License as published by 24 | % the Free Software Foundation; either version 2 of the License, or 25 | % (at your option) any later version. 26 | % 27 | % This program is distributed in the hope that it will be useful, 28 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | % GNU General Public License for more details. 31 | % 32 | % You can obtain a copy of the GNU General Public License from 33 | % http://www.gnu.org/copyleft/gpl.html or by writing to 34 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 35 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 | persistent a b 37 | if isempty(a) 38 | a=[1 3 2 4]; 39 | b=[1 1i]; 40 | end 41 | s=size(qr); 42 | qq=reshape(qr,4,[]); 43 | s(1)=s(1)/2; 44 | qc=reshape(b*reshape(qq(a,:),2,[]),s); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/rotqrvec.m: -------------------------------------------------------------------------------- 1 | function y=rotqrvec(q,x) 2 | %ROTQRVEC applies a quaternion rotation ot a vector array y=[q,x] 3 | % 4 | % Inputs: q(4,1) quaternion rotation (possibly unnormalized) 5 | % x(3n,...) array of 3D column vectors 6 | % 7 | % Outputs: y(3n,...) array of 3D column vectors 8 | 9 | % Copyright (C) Mike Brookes 2011-2012 10 | % Version: $Id: rotqrvec.m 1640 2012-03-16 07:43:08Z dmb $ 11 | % 12 | % VOICEBOX is a MATLAB toolbox for speech processing. 13 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 14 | % 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % This program is free software; you can redistribute it and/or modify 17 | % it under the terms of the GNU General Public License as published by 18 | % the Free Software Foundation; either version 2 of the License, or 19 | % (at your option) any later version. 20 | % 21 | % This program is distributed in the hope that it will be useful, 22 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | % GNU General Public License for more details. 25 | % 26 | % You can obtain a copy of the GNU General Public License from 27 | % http://www.gnu.org/copyleft/gpl.html or by writing to 28 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | s=size(x); 31 | y=reshape(rotqr2ro(q)*reshape(x,3,[]),s); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/shorten.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/shorten.exe -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/sone2phon.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/sone2phon.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/spendred.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/spendred.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/spgrambw.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/spgrambw.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/sprintsi.m: -------------------------------------------------------------------------------- 1 | function s=sprintsi(x,d,w) 2 | %SPRINTSI Print X with SI multiplier S=(X,D,W) 3 | % D is number of decimal places (+ve) or significant digits (-ve) [default=-3] 4 | % |W| is total width including multiplier 5 | % if W<=0 then trailing 0's will be eliminated 6 | % 7 | % Example: sprintsi(2345,-2) gives '2.3 k' 8 | 9 | % Copyright (C) Mike Brookes 1998 10 | % Version: $Id: sprintsi.m 4966 2014-08-05 18:20:41Z dmb $ 11 | % 12 | % VOICEBOX is a MATLAB toolbox for speech processing. 13 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 14 | % 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % This program is free software; you can redistribute it and/or modify 17 | % it under the terms of the GNU General Public License as published by 18 | % the Free Software Foundation; either version 2 of the License, or 19 | % (at your option) any later version. 20 | % 21 | % This program is distributed in the hope that it will be useful, 22 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | % GNU General Public License for more details. 25 | % 26 | % You can obtain a copy of the GNU General Public License from 27 | % http://www.gnu.org/copyleft/gpl.html or by writing to 28 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | if nargin<3 w=0; end; 32 | if nargin<2 d=-3; end; 33 | f='afpnum kMGT'; 34 | e=max(-18,min(12,floor(log10(abs(x))))); 35 | k=floor(e/3); 36 | dp=max([0 d 3*k-d-e-1]); 37 | if w<=0 & dp 38 | w=abs(w); 39 | dp=max(find([1 mod(mod(round(x*10^(dp-3*k)),10^dp),10.^(dp:-1:1))]))-1; 40 | end 41 | if(k) 42 | s=sprintf(sprintf('%%%d.%df %c',max(w-2,0),dp,f(k+7)),x*1e-3^k); 43 | else 44 | s=sprintf(sprintf('%%%d.%df ',max(w-1,0),dp),x*1e-3^k); 45 | end 46 | -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/ssubmmse.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/ssubmmse.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/ssubmmsev.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/ssubmmsev.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/stdspectrum.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/stdspectrum.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/stoi2prob.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/stoi2prob.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/teager.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/teager.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/upolyhedron.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/upolyhedron.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/v_windinfo.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/v_windinfo.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/v_windows.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/v_windows.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/vadsohn.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/vadsohn.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/winenvar.m: -------------------------------------------------------------------------------- 1 | function d=winenvar(n) 2 | %WINENVAR get windows environment variable [D]=(N) 3 | % 4 | % Inputs: N name of environment variable (e.g. 'temp') 5 | % 6 | % Outputs: D value of variable or [] is non-existant 7 | % 8 | % Notes: (1) This is WINDOWS specific and needs to be fixed to work on UNIX 9 | % (2) The search is case insensitive (like most of WINDOWS). 10 | % 11 | % Examples: (1) Open a temporary text file: 12 | % d=winenar('temp'); fid=fopen(fullfile(d,'temp.txt'),'wt'); 13 | 14 | % Copyright (c) 2005 Mike Brookes, mike.brookes@ic.ac.uk 15 | % Version: $Id: winenvar.m 713 2011-10-16 14:45:43Z dmb $ 16 | % 17 | % VOICEBOX is a MATLAB toolbox for speech processing. 18 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 19 | % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % This program is free software; you can redistribute it and/or modify 22 | % it under the terms of the GNU General Public License as published by 23 | % the Free Software Foundation; either version 2 of the License, or 24 | % (at your option) any later version. 25 | % 26 | % This program is distributed in the hope that it will be useful, 27 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | % GNU General Public License for more details. 30 | % 31 | % You can obtain a copy of the GNU General Public License from 32 | % http://www.gnu.org/copyleft/gpl.html or by writing to 33 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | p=['%',n,'%']; 36 | [s,d]=system(['echo ',p]); 37 | while d(end)<=' '; 38 | d(end)=[]; 39 | end 40 | if strcmp(d,p) 41 | d=[]; 42 | end -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/xyzticksi.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/xyzticksi.m -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/zerotrim.m: -------------------------------------------------------------------------------- 1 | function z=zerotrim(x) 2 | %ZEROTRIM Remove zero trailing rows and columns Z=(X) 3 | % returns a null matrix if x is all zero. 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % Version: $Id: zerotrim.m 713 2011-10-16 14:45:43Z dmb $ 7 | % 8 | % VOICEBOX is a MATLAB toolbox for speech processing. 9 | % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 10 | % 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % This program is free software; you can redistribute it and/or modify 13 | % it under the terms of the GNU General Public License as published by 14 | % the Free Software Foundation; either version 2 of the License, or 15 | % (at your option) any later version. 16 | % 17 | % This program is distributed in the hope that it will be useful, 18 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | % GNU General Public License for more details. 21 | % 22 | % You can obtain a copy of the GNU General Public License from 23 | % http://www.gnu.org/copyleft/gpl.html or by writing to 24 | % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | c=max(find(any(x,1))); 28 | r=max(find(any(x,2))); 29 | z=x(1:r,1:c); -------------------------------------------------------------------------------- /matlab_lib/sub_lib/voicebox/zoomfft.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sytronik/denoising-wavenet-pytorch/f29471d9d0752f3599452bab9737e1d7b6809906/matlab_lib/sub_lib/voicebox/zoomfft.m -------------------------------------------------------------------------------- /model/__init__.py: -------------------------------------------------------------------------------- 1 | from .dwavenet import DWaveNet 2 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | import os 3 | from pathlib import Path 4 | from typing import Callable, Union 5 | 6 | import numpy as np 7 | 8 | 9 | def arr2str(a: np.ndarray, format_='e', ndigits=2) -> str: 10 | """convert ndarray of floats to a string expression. 11 | 12 | :param a: 13 | :param format_: 14 | :param ndigits: 15 | :return: 16 | """ 17 | return np.array2string( 18 | a, 19 | formatter=dict( 20 | float_kind=(lambda x: f'{x:.{ndigits}{format_}}' if x != 0 else '0') 21 | ) 22 | ) 23 | 24 | 25 | def print_to_file(fname: Union[str, Path], fn: Callable, args=None, kwargs=None): 26 | """ All `print` function calls in `fn(*args, **kwargs)` 27 | uses a text file `fname`. 28 | 29 | :param fname: 30 | :param fn: 31 | :param args: args for fn 32 | :param kwargs: kwargs for fn 33 | :return: 34 | """ 35 | if fname: 36 | fname = Path(fname).with_suffix('.txt') 37 | 38 | if args is None: 39 | args = tuple() 40 | if kwargs is None: 41 | kwargs = dict() 42 | 43 | with (fname.open('w') if fname else open(os.devnull, 'w')) as file: 44 | with contextlib.redirect_stdout(file): 45 | fn(*args, **kwargs) 46 | --------------------------------------------------------------------------------