8

Two problems here: how to get a reliable estimate of the level, and how to compress the data. Use robust statistics on the original (not peak-limited) data like median or quantiles instead of a running average to make your "typical level" detection robust to outliers. $k \times \tanh(\frac{x}{k})$ works nice as a $C^\infty$ compression formula and it is ...


4

Regarding advantages - there is only one I can think of... The soft knee makes the compressor less noticeable. It sounds more natural, especially when you are dealing with higher compression ratios (like 4:1, etc.). On the other hand, if you want to participate in the "Loudness War", then you should rather use hard knee, as it allows you to squeeze out ...


4

Here are some suggestions: There are plenty of opensource implementations (Sox, Audacity, etc). Even if you don't understand them, you might be able to translate the code from C to javascript. I'm not aware of a good explanation of the process online, but there are plenty of books on the subject: Digital audio signal processing covers this topic and is ...


3

from your posted waveform, i am assuming that this is a unipolar signal. that is $$ x[n] \ge 0 $$ in audio, it would be the same, except that we would be working on $|x[n]|$ instead. so first you want a sliding maximum of your signal, where the window length is $L$. $$ x_1[n] = \max_{0 \le i < L} \Big| x[n-i] \Big| $$ since your input signal $x[n]$ ...


2

For actual implementations take a look at (C) programming codes for decoders. Basically the process is simple, you create an abstraction such as bits = get_bits(n) Where, n is the n bits you want to read. the var bits is left aligned. It extracts it from some byte_buffer - say a 32 bit or 64 bit symbols. NOTE: All, practical codecs put major symbols ...


2

here's an efficient sliding maximum algorithm that has cost that is $O(\log_2(L))$. below window_width is $L$. comes from Brookes: "Algorithms for Max and Min Filters with Improved Worst-Case Performance" IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—II: ANALOG AND DIGITAL SIGNAL PROCESSING, VOL. 47, NO. 9, SEPTEMBER 2000 #define A_REALLY_LARGE_NUMBER 3....


2

For a simple start I would use a non-linear characteristic $g(x)$ that compresses your input signal: $$ y = g\left(x\right) $$ where (as pointed out by endolith in the comments) $x$ is the envelope of the input audio signal and $y$ is the output envelope that is applied to the actual audio signal. $g(x)$ can be any function that attenuates large input ...


2

Thresholding should reduce the file size to the limits of the encoder being used. AAC/H.264 are using the state of the art general purpose audio compression codecs (which could only be beaten by application specific optimized codecs, such as speech vocoders etc). May be your files are already minimal? Put some numerical data such as the sampling rate, ...


2

According to the source that your block diagram is taken from [Udo Zölzer - Digitale Audiosignalverarbeitung], the Range Detector is an arbiter whose decision is not based on the output of the three nodes, but rather on the region of operation of the static characteristic that your calculated $x_{RMS}(n)$ is found in: So, if $x_{RMS}(n)$ is below $NT$, the ...


2

To make it more clear, I suppose your question is Why it is said that the compressor gain at low input amplitudes is higher, while the step size of a nonuniform quantizer is small in that region. Similarly, Why it is said that the gain of the compressor is higher for high input amplitudes, while the step size is larger for those inputs. First, notice ...


2

It sounds better this way. Let's say you have limiter and you can't exceed a certain amplitude value (risk of clipping, for example). Now there is an audio event (say a snare hit) that peaks at twice that amplitude. If you just reduce this sample by sample instantaneously you create a lot of audible distortion. If you have look ahead, you can ramp down the ...


1

You can get pretty good results with an approximate linear chirp spread out over the period: $$s(x) = \sum\limits_{n=1}^{N} \cos\left(2\pi \left(x n+ \frac{n^2}{2\times N}\right)\right), \quad N=10$$ $$m \approx 4.28$$ Group delay is the derivative of the phase with respect to frequency. For a linear (frequency as function of time) chirp, the phase should ...


1

You should get rather good results with using both a) a hard noise gate (so that the material compresses perfectly when you are having silence) b) a variable bit rate recording: MP3 as well as OGG/Vorbis encoders can readily provide those. When you are planning on eventually analyzing breathing patterns, of course the noise gate will either not be effective ...


1

You might try using some sort of activity detector algorithm, and just not feed the codec any data (not even zeros) when no activity was detected. For the time stamps, you might prepend recorded activity with an FSK time mark and/or voice synthesized time announcement, and feed that to the codec in front of the captured audio samples.


1

If I were so inclined to do what you want to do( I have 3 children, youngest is 25 , so I'm not so inclined) , I would use a motion detector to trigger recording for the first few months. Crying is usually accompanied with vigorous hand and arm motion. There are a number of wifi video cameras with integrated motion detectors and microphones, as well as ...


1

[EDIT: improved the graphics and code] If you call $S$ the sigmoid function (left), and $Q_{\text{u}}$ the uniform quantization operator, the right plot is obtained by: $$Q_{\text{nu}} =S^{-1}(Q_{\text{u}}(S(\cdot)))$$ as illustrated in from this basic Matlab code: time = linspace(-1,1,1000); Q=4; % Number of bits (almost) Qu = round(time*2^Q)/2^Q; % ...


1

depends on if you like discontinuities in your signal or parameter processing chain, or if you like it if the mathematics is as continuous as possible. how to implement a soft knee? consider this function: $$ f(x) \ = \ \alpha_0 \ x \ - \ \beta \ \log_2 \left(1 + 2^{\frac{\alpha_0 - \alpha_1}{\beta} (x - x_0)} \right) $$ for $ 0 < \alpha_1 < \...


1

May be you can try the following: dbnew = dbmax * (1 + log((db-dbmin)/(dbmax-dbmin))) dbnew = -inf when db = dbmin and dbnew = dbmax when db = dbmax. Please let me know if it works.


Only top voted, non community-wiki answers of a minimum length are eligible