Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
c5a6857
wip group delay
drowe67 Nov 4, 2021
c887ed4
need est_no.c utility for group delay experiments
drowe67 Nov 4, 2021
33a7486
est_n0 test running
drowe67 Nov 5, 2021
52e071c
really fix est_n0 ctest!
drowe67 Nov 5, 2021
b074d56
plotting group delay with linear (n0) removed
drowe67 Nov 5, 2021
b7396e9
plotting phase delay
drowe67 Nov 5, 2021
2b5bfe3
ability to toggle between original and phase0
drowe67 Nov 6, 2021
c461da1
script to automate generation of files for plphase.m
drowe67 Nov 6, 2021
0c5c5b3
experimental phase spectra script
drowe67 Nov 11, 2021
5a2ab3d
plot synthetised speech
drowe67 Nov 11, 2021
9cf0ce1
close file when finished
drowe67 Nov 11, 2021
a75f63b
refactored
drowe67 Nov 23, 2021
c04d330
dispersive phase model using sawtooth t0 function
drowe67 Nov 23, 2021
1af24ca
phase experiments across many conditions, C dispersion models
drowe67 Nov 27, 2021
0ab2f67
add a few more files and conditions
drowe67 Nov 30, 2021
c036b2a
support for comparing (i) orig Am -> phase0 with (ii) ratek Am -> phase0
drowe67 Nov 30, 2021
6841505
unwrapping phase, GD colour
drowe67 Dec 3, 2021
62116d5
add offset to make sure phase spectra line up when unwrapping
drowe67 Dec 4, 2021
e331a27
argument for changing K
drowe67 Dec 5, 2021
e18a14e
nicer plots, generating phase_exp.sh samples
drowe67 Dec 6, 2021
de1cfe6
Merge branch 'master' into dr-papr
drowe67 Apr 25, 2022
1cd2edd
first pass at compression of {Am}
drowe67 Apr 26, 2022
aaa6e12
added min for hilbert clipper to experiment with constraining dynamic…
drowe67 Apr 28, 2022
88c9c2a
building up compressor with AGC in script form
drowe67 Apr 28, 2022
7a6fd12
added upper and lower rateK limits
drowe67 Apr 29, 2022
fd50c80
text spacing
drowe67 Apr 30, 2022
4fa5192
dump rateK vecs after mean limiting
drowe67 Apr 30, 2022
f1d7b9b
first pass at output samples from comp VQ
drowe67 Apr 30, 2022
f0825a6
tweak formatting
drowe67 May 2, 2022
5c6981d
wip VQ training experiments
drowe67 May 2, 2022
6261bf3
exploring effect of postfilter
drowe67 May 2, 2022
d2b6e2f
3 stage subset VQ with AGC
drowe67 May 2, 2022
6126f49
WIP - two candidate 3 stage VQs, cleaned up script
drowe67 May 3, 2022
9b0d5c8
200Hz HPF option
drowe67 May 4, 2022
a38ccbc
200 Hz hpf tool
drowe67 May 5, 2022
715a5ab
3 stage HPF+AGC candidate, nice and loud, speech quality OK, extended…
drowe67 May 5, 2022
187ebf2
subset vq pager to visualise train_comp.sh VQs in action
drowe67 May 7, 2022
19f83b5
VQ paged to let us explore trained VQs
drowe67 May 11, 2022
c19f72e
extract utility writeall option
drowe67 May 11, 2022
5fa1097
more experiments, newamp1 postfilter
drowe67 May 11, 2022
18aca60
first pass at two band freq domain hilbert compressor
drowe67 May 11, 2022
b7bcd24
moved HC after phase0
drowe67 May 13, 2022
a2730c5
VQ with HC doesn't sound correct, but nm2 works/sounds well
drowe67 May 13, 2022
5577fa0
fixed unitialised value bug, make sure it zeros out unused parts of r…
drowe67 May 13, 2022
1490b94
c2sim calculates mean beywee K_st and K_en
drowe67 May 13, 2022
8395f65
clean up train_comp, just nm2 and two band comp candidates now
drowe67 May 13, 2022
d04714f
fixed vq_mbest ctest
drowe67 May 13, 2022
4a3a8a1
removed eband support. First pas at rateK mean compressor
drowe67 May 23, 2022
401eeaa
clean up option strings
drowe67 Jun 24, 2022
52e9a07
wip resampler doc
drowe67 Sep 3, 2022
89ecf28
another wip checkpoint
drowe67 Sep 4, 2022
66d57f4
git hash now works on branch rather than master
drowe67 Sep 4, 2022
7f96317
wip experiment 1 - high sample rate linear test
drowe67 Sep 6, 2022
5fb2646
wip rateK experiment 1
drowe67 Sep 8, 2022
21ef6de
wip writing up Experiment 1
drowe67 Sep 8, 2022
1eda0a5
introduced F()
drowe67 Sep 9, 2022
b884237
wip filtering maths
drowe67 Sep 12, 2022
c1ee626
derivation of warp(k,K)
drowe67 Sep 15, 2022
22a5af4
updated filter definition, filter bank example
drowe67 Sep 16, 2022
a81b594
experiment 2 - fbf with filter
drowe67 Sep 18, 2022
c5781a6
Experiment 2 Octave scripts
drowe67 Sep 22, 2022
16f7a5b
padd ends to make spline interpolator handle edges better
drowe67 Sep 22, 2022
0d1a287
Experimnet 2 write up
drowe67 Sep 22, 2022
fd798f3
experiment too to plot Ym for different Nb
drowe67 Sep 23, 2022
f0a799c
moved ratek resampler .tex and .pngs to a new folder
drowe67 Sep 23, 2022
7ac5794
first pass at training a VQ with filtering, results written up
drowe67 Sep 23, 2022
b2398d2
adding LBG split option to vqtrain
drowe67 Sep 25, 2022
e1e4ccd
Merge branch 'dr-papr' of github.com:drowe67/codec2 into dr-papr
drowe67 Sep 25, 2022
3d2489d
LBG split mode working in vqtrain
drowe67 Sep 25, 2022
1de6b31
plot curves of Eq versus VQ quantiser bits, and write up
drowe67 Sep 25, 2022
ab515cd
VQ stage2 slope discussion
drowe67 Sep 26, 2022
a53d7d2
prototype rate Lhigh resampling, attempt at more efficient filtering
drowe67 Sep 30, 2022
94269a8
ratek2_high_fbf.m can test 1 or 2 stage VQ, VQ test function for rate…
drowe67 Oct 2, 2022
82f931b
documenting rate Lhigh and VQ training results
drowe67 Oct 8, 2022
6d35c6d
plots showing 2 stage VQ and pitch dep spectral envelope
drowe67 Oct 8, 2022
53da8f8
discussion on pitch dependance
drowe67 Oct 8, 2022
2a50609
scripts for synthesising speech with vq1,vq2. On first listen the ma…
drowe67 Oct 9, 2022
49d66fe
rewording and extra discussion of first pass VQ take aways
drowe67 Oct 9, 2022
7125ed3
post filter requirements and spelling
drowe67 Oct 20, 2022
7106639
make Nb a variable
drowe67 Oct 28, 2022
fb6581e
first pass at a post filter based on dy/df - not very satisfactory
drowe67 Oct 28, 2022
284d451
spelling
drowe67 Oct 28, 2022
706cc72
rm local dictionary, only system one works
drowe67 Oct 28, 2022
87a39d9
function to testimate LPC model from mag spectrum
drowe67 Oct 29, 2022
42a7e30
set up bibliography, add some references, insert latest notes on PAPR…
drowe67 Oct 29, 2022
94865f2
LPC model being plotted
drowe67 Oct 29, 2022
85dc673
experiments with plotting EPS, and building up LPC post filter
drowe67 Nov 4, 2022
d05384b
writing up group delay interpretation
drowe67 Nov 4, 2022
42124e5
building up fbf tool for exploring time domain envelope of synthesise…
drowe67 Nov 4, 2022
fcee00b
plphase2.m UI tweaks, instructions, experimental PAPR reduction via p…
drowe67 Nov 10, 2022
ffd6af3
plphase2 make group/phase delay plot optional
drowe67 Nov 11, 2022
c5777cd
refactor ampl and phase post filters into functions
drowe67 Nov 11, 2022
3440529
Calculate and display band pass PAPR
drowe67 Nov 11, 2022
2b40e7f
ratek2_model_postfilter to support postfilter listening tests with c2…
drowe67 Nov 12, 2022
94ad25e
option to use original amplitudes to generate phase0
drowe67 Nov 12, 2022
53fc3d5
ratek_resampler.sh, postfilter_test() function generating samples
drowe67 Nov 12, 2022
084d57d
adjusted amp PF coeff down to reduce distortion
drowe67 Nov 12, 2022
e886f05
tdetphase working again
drowe67 Nov 17, 2022
92dd7e6
cleaning up determine_phase() Octave test, including demo of fail cas…
drowe67 Nov 18, 2022
a6999fc
room impulse response
drowe67 Nov 19, 2022
9d788eb
variable group delay (smear) option
drowe67 Nov 19, 2022
88b6ee3
support for variable group delay (smear) option in listening tests - …
drowe67 Nov 19, 2022
23ceee6
vary amp pf slope across freq to overcome Nb filtering, noticable imp…
drowe67 Nov 19, 2022
426fc9b
Merge branch 'dr-papr' of github.com:drowe67/codec2 into dr-papr
drowe67 Nov 19, 2022
af5d6a4
-depsc plots as a starting point, font size a bit big
drowe67 Nov 25, 2022
57a8f3f
EPS Latex plots working, documented traps in README.md
drowe67 Nov 25, 2022
9b394e3
remove n0 logic, group delay plots working
drowe67 Nov 25, 2022
1e7b81a
measuring CPAPR, instead of PAPR, sensible CPAPR results now
drowe67 Nov 26, 2022
8f8c8a4
refactored to generate a nice 3 subplot figure for Latext report
drowe67 Nov 26, 2022
b6e4bed
Latex/EPS files for plots
drowe67 Nov 26, 2022
bd63a49
refactor ampl pf after maths write up
drowe67 Nov 26, 2022
739925a
automatically save/restore font and line sizes when printing, print d…
drowe67 Nov 26, 2022
3298edc
draft of post filter write up, including references
drowe67 Nov 27, 2022
cc3aa00
rewording, speel check, edits
drowe67 Nov 28, 2022
1df3eab
wip unified simulation function
drowe67 Dec 17, 2022
feef81f
moving unified batch processing into a new Octave file
drowe67 Dec 26, 2022
fdae343
building up ratek3_batch_tool() functionality
drowe67 Dec 26, 2022
e71460e
postfilter_rate_test in ratek_resampler.sh script working OK
drowe67 Dec 27, 2022
3a5127e
generation of VQ training material with amp pf applied, VQ training, …
drowe67 Jan 1, 2023
a094afa
WIP EQ using amp PF slope, mixed results
drowe67 Jan 2, 2023
349ce2b
PF required on all frequencies, not just high
drowe67 Jan 4, 2023
18c3235
loading of binary model records into Octave, verified --dump and --mo…
drowe67 Jan 5, 2023
c78f979
alternate naming of train_b.f32 file
drowe67 Jan 5, 2023
faee03f
batch processing tool uses binary model files
drowe67 Jan 5, 2023
85d46eb
output number of times each vector is used, usefule for PDF or CDF an…
drowe67 Jan 5, 2023
b8bc09d
ability to varty vector dimension K
drowe67 Jan 5, 2023
a06def6
VQs named after training _b.f32 file
drowe67 Jan 6, 2023
28ec350
reconcille batch and fbf Eq and VQ indexes
drowe67 Jan 6, 2023
3a93a28
dynamic range clamp feature
drowe67 Jan 6, 2023
c5671e1
40dB dynamic range limit
drowe67 Jan 6, 2023
e732f1c
provision for weighted VQ search
drowe67 Jan 6, 2023
0fc7a4f
first pass at decimation in time
drowe67 Jan 6, 2023
ef1b65d
specifiy VQ dimension in pager
drowe67 Jan 6, 2023
80ee81c
eq2 & DR experiment
drowe67 Jan 7, 2023
5352839
first pass subset VQ working
drowe67 Jan 7, 2023
ca2f4cb
trying eq-ed subset VQ, but quality not very good - suspect bug
drowe67 Jan 9, 2023
e211a56
fixed a few bugs in subset, but stage1 vq quality not great
drowe67 Jan 9, 2023
503da6d
script to estimate bits required to quantise a dataset
drowe67 Jan 19, 2023
225995f
env variable for batch tool options
drowe67 Jan 19, 2023
a2989f5
building up system to plot VQ var against bits
drowe67 Jan 19, 2023
3c78326
catting stage2 onto stage1, reference scalar 6dB/bit line
drowe67 Jan 20, 2023
6028c5e
mbest curve, which curiously doesn't help at all
drowe67 Jan 20, 2023
1bb93ad
split, subset, K=20 curves
drowe67 Jan 22, 2023
f436b1b
optional 2nd stage VQ
drowe67 Jan 22, 2023
99748e1
first pass at split quantiser
drowe67 Jan 25, 2023
440a5fe
first pass at time-freq VQ, good results for 40ms frames
drowe67 Jan 26, 2023
c559806
refining split experiments to extract mean correctly, one mean for 40…
drowe67 Jan 27, 2023
ca318a1
debugged time-freq, sensible results but 26 bit/s + 2 means is not great
drowe67 Jan 27, 2023
9f7ea24
typo
drowe67 Jan 27, 2023
8e0abe7
first pass at VQ with compression - but no improvement
drowe67 Jan 27, 2023
80074d1
wip hilbert compressor - single band doing sensible things
drowe67 Jan 27, 2023
acb6e1b
experiment to compare energy of Bm and Am against F0, no clear advant…
drowe67 Jan 28, 2023
cccd566
first pass at two band compressor, no VQ improvement
drowe67 Jan 28, 2023
04c677b
tried mean_l2 (mean based on mean linear energy) but no improvement i…
drowe67 Jan 29, 2023
8727430
back to single band compressor, with dynamic range limiting of 30dB, …
drowe67 Jan 29, 2023
128fe6e
moved amp_pf to after VQ, speech quality with one stage VQ not great
drowe67 Jan 29, 2023
3e52217
added features for weighting for VQ search, injection of quant noise,…
drowe67 Jan 29, 2023
dcdb8cf
230202 list test: vq1/vq2, amp pf rate L after VQ, weighted search
drowe67 Feb 2, 2023
1bc03f9
adding pre-emphasis and dynamic range limiting
drowe67 Feb 3, 2023
f763860
230204 listening tests, no real different with pre-emp or DR limiting
drowe67 Feb 4, 2023
0af204c
option for no training, just random sampling
drowe67 Feb 4, 2023
72cbb6f
align fbf with current batch processing
drowe67 Feb 4, 2023
f08290c
log file of Eq, 3 stage VQs, zero out LF when decimating
drowe67 Feb 4, 2023
0c708fe
230202 #2, comparing 1x12, 2x12, 2,9, 3x9 VQs
drowe67 Feb 4, 2023
ec1c183
added pred2 feeature, extract x[n-1]-(x[n]+x[n-3])/2
drowe67 Feb 8, 2023
d3d9058
prototype wieghting based on amplitude from peak, resulted in a few V…
drowe67 Feb 8, 2023
ca6450f
restore legend position
drowe67 Feb 8, 2023
8df6909
sub2 (wider range subset) and pred2 support
drowe67 Feb 8, 2023
22c03be
fbf implementation of single stage weighted search
drowe67 Feb 9, 2023
c0b9f77
fbf filter equaliser using closed form expression, looks good
drowe67 Feb 9, 2023
e3b28df
setting up mic EQ in batch mode
drowe67 Feb 13, 2023
506feb1
weighted search moved to lib function
drowe67 Feb 18, 2023
bf9503f
experimental candidate B mic equaliser, reasonable Eq results
drowe67 Feb 18, 2023
1840556
230217 EQ1 and EQ2 test, EQ2 seems to do quite a good job, Eqs in zlo…
drowe67 Feb 18, 2023
13522ec
vk5dgr samples
drowe67 Feb 20, 2023
9c78ca8
fix sample rate of two lines
drowe67 Feb 20, 2023
5840f38
ch with impulse simulation
drowe67 Feb 23, 2023
5aac52f
added EQ2 and 1x12 bit, dec3 outputs to 230204
drowe67 Feb 25, 2023
e9a3ff3
added two lines wav file
drowe67 Feb 25, 2023
46599ec
Octave script to prototype time domain envelope/PAPR/phase algorithms…
drowe67 Feb 25, 2023
bd51786
refactored tenv.m
drowe67 Feb 25, 2023
873b081
rand50 algorithm - randomising phases when F0==50Hz, didn't help two_…
drowe67 Mar 1, 2023
5a7187c
typo
drowe67 Mar 1, 2023
1d9f210
plot orig speech
drowe67 Mar 1, 2023
db3ff18
fbf tool to explore click problem
drowe67 Mar 1, 2023
44cad4b
shell script support for two_lines click experiments
drowe67 Mar 1, 2023
4b10711
resolve conflict
drowe67 Mar 1, 2023
ed546ee
Merge branch 'dr-papr' of github.com:drowe67/codec2 into dr-papr
drowe67 Mar 2, 2023
4fa048f
energy normalisation function and test
drowe67 Mar 4, 2023
1387ca5
combined interp1 and energy norm function
drowe67 Mar 4, 2023
cd75797
removed rand50
drowe67 Mar 4, 2023
819560e
energy norm listening tests, experiment 230326, ampl of big clicks in…
drowe67 Mar 5, 2023
107e9aa
typo
drowe67 Mar 23, 2023
7f4845f
building up mulaw compressor, but not satisfactory
drowe67 Mar 23, 2023
97d3fc4
typos
drowe67 Mar 23, 2023
81f4506
syntheisis converted to use complex FFT so we can try hilbert clippin…
drowe67 Mar 23, 2023
ae4eb56
Merge branch 'dr-papr' of github.com:drowe67/codec2 into dr-papr
drowe67 Mar 23, 2023
9c1a7c8
hilbert clipping of synthesised signal
drowe67 Mar 24, 2023
a21915a
piecewise linear compressor and test
drowe67 Mar 24, 2023
a36e3c2
230323 compression experiment, has sing song level variations in some…
drowe67 Mar 24, 2023
cd1f352
typo
drowe67 Mar 24, 2023
2ef2341
compresssion of energy rather than means, works quite well on most sa…
drowe67 Mar 24, 2023
3e7f20f
experiment 230323 applied gain just before synthesis, performing comp…
drowe67 Mar 24, 2023
27bc45e
230323 experiment 2 - mean limiting, works quite well
drowe67 Mar 31, 2023
aea6aa0
plot mean CDF, 3 bit mean quantiser design
drowe67 Apr 1, 2023
197e6dd
experiment 230331 - 27 and 12 bit VQ with 3 bit mean quantiser + HC. …
drowe67 Apr 1, 2023
cda4a11
removed gainoutlin (10dB make up gain) to get comparable levels. How…
drowe67 Apr 6, 2023
b679569
230331 experiment modified to do 4 bit energy quantisation. Sounds OK…
drowe67 Apr 7, 2023
a8b36c9
typed up derivation of EQ2 algorithm
drowe67 Apr 7, 2023
1ab45e1
skeleton of sections
drowe67 Apr 7, 2023
6f1f504
mean and energy quantisation section
drowe67 Apr 7, 2023
82aeb75
re-org sub sections
drowe67 Apr 7, 2023
338804d
added .tex scatter plot of e v mean
drowe67 Apr 8, 2023
86f12e2
thinned out scatter plot data for smaller files
drowe67 Apr 8, 2023
fd517cb
energy normalisation section
drowe67 Apr 8, 2023
a6dcca0
summary table of software
drowe67 Apr 8, 2023
2f90305
support for VQ performance plots
drowe67 Apr 8, 2023
d9cd1c9
re-org VQ distortion plots
drowe67 Apr 8, 2023
d8f09b7
drafted VQ experiment section
drowe67 Apr 9, 2023
c57e4d0
FreeDV doc number
drowe67 Apr 9, 2023
92eaa5a
misc section and HC plot
drowe67 Apr 9, 2023
44bae5a
README.md edits and formatting
drowe67 Apr 9, 2023
96eb762
typos
drowe67 Apr 10, 2023
898cb25
Merge branch 'dr-papr' of github.com:drowe67/codec2 into dr-papr
drowe67 Apr 10, 2023
e430c43
committing PDF
drowe67 Sep 1, 2023
c43d295
change precision to support misc/analog ML quant experiments
drowe67 Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,18 @@ endif(NOT APPLE)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src
)

add_test(NAME test_est_n0
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/unittest;
PATH=$PATH:${CMAKE_CURRENT_BINARY_DIR}/src:${CMAKE_CURRENT_BINARY_DIR}/misc;
./est_n0.sh"
)
add_test(NAME test_vq_mbest
COMMAND sh -c "./tvq_mbest; \
cat target.f32 | \
../misc/vq_mbest -k 4 -q vq1.f32,vq2.f32 --st 1 --en 2 --mbest 2 -v > /dev/null;"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unittest
)
set_tests_properties(test_vq_mbest PROPERTIES PASS_REGULAR_EXPRESSION "MSE: 0.00")
set_tests_properties(test_vq_mbest PROPERTIES PASS_REGULAR_EXPRESSION "var: 0.00")

add_test(NAME test_700c_eq
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/unittest;
Expand Down
Binary file added doc/ratek_resampler/20_100_vq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions doc/ratek_resampler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
A study of the codec2 700C Rate K resampler

# Basic setup:

```
$ sudo apt install texmaker texlive-bibtex-extra
$ texmaker ratek_resampler.tex &
```

1. Options -> Config Texmaker -> Quick Build -> select 2nd option: "PDFLatex+BibLatex+PDFLatex2+ViewPDF"
1. Open `ratek_resampler.tex`
1. F1 to build document.

# Latex/EPS figures from Octave:

Gotchas:
1. Watch out for any control characters like & or _ in figure text, this will cause the build step to choke.
1. In `/path/to/ratek_resampler` Optionally clean out any older .eps files of same name (e.g. previously rendered with encapsulated Postscript).
1. In texmaker, build PDF from `ratek_resampler.tex`, not the figure `.tex` file (e.g. testepslatex.tex), you might end up in the latter if an error was encountered.

For nice rendering on your monitor, there may be some non-standard font and line size defaults set up in `.octaverc`, e.g.:
```
set(0, "defaulttextfontsize", 24) % title
set(0, "defaultaxesfontsize", 24) % axes labels
set(0, "defaultlinelinewidth", 2)
```
For Latex/EPS plots, save these defaults, and set up fontsize 10, line size 0.5 before plotting:

```
textfontsize = get(0,"defaulttextfontsize");
linewidth = get(0,"defaultlinelinewidth");
set(0, "defaulttextfontsize", 10);
set(0, "defaultaxesfontsize", 10);
set(0, "defaultlinelinewidth", 0.5);
```

Render your figure then print in EPS Latex using:

```
octave:1> print("testepslatex","-depslatex","-S300,300");
```

After plotting, the defaults can be restored:

```
set(0, "defaulttextfontsize", textfontsize);
set(0, "defaultaxesfontsize", textfontsize);
set(0, "defaultlinelinewidth", linewidth);
```

Latex code to insert figure:
```
\begin{figure}[h]
\caption{Test Octave -depslatex}
\begin{center}
\input testepslatex.tex
\end{center}
\end{figure}
```
Binary file added doc/ratek_resampler/filters_h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading