Delta modulation with GNU Radio

今回はデルタ変調の例題をご紹介します。

正確にはContinuously Variable Slope Delta Modulationで、音声を符号化する手法で体表的なものです。

詳細はこちらのページを参照してください。

Continuously variable slope delta modulation

(1) まず、下記のようなフロー図を準備します。

GRCファイルは下記のリンクでダウンロードできます。

Delta_modulation_Tutorial.grc

Screenshot from 2016-01-04 16-06-35

(2) VCO Block

Voltage controlled oscillator, which outputs a sinusoid of a frequency that is a function of the input voltage. The input is float stream of control voltages and the output is a float oscillator output.

VCO

(3) CSVD Encoder block

Continuously variable slope delta modulation (CVSD or CVSDM) is a voice coding method. It is a delta modulation with variable step size.

The incoming samples are compared against a reference sample and step size. If the input sample is larger than reference sample the encoder emits one and adds step size to the reference sample and if it is smaller the encoder outputs zero and subtracts step size from the reference sample.

Common bit-rates are 9.6-128 kbit/s

CSVD_Encoder

The CVSD encoder performs interpolation and filtering necessary to work with the voice coding. It converts an incoming float (-/+1) to a short, scales it slightly below the maximum value, interpolates it and then vocodes it.

The incoming sampling rate can be anything, though, of course, the higher the sampling rate and the higherthe interpolation rate are, the better the sound quality.

(4) CSVD Decoder block

Continuously variable slope delta modulation decoder reverses the process of the CVSD Encoder. The sequence of adjusted reference samples are the reconstructed waveform.

CVSD_Decoder

The CVSD Decoder performs decimation and filtering necessary to work with the vocoding. It converts an incoming CVSD-encoded short to a float, decodes it to a float, decimates it, and scales it slightly below the maximum value to avoid clipping.

(5) Packed to Unpacked block

It converts a stream of packed bytes or shorts to stream of unpacked bytes or shorts. The Endianness is Big Endian which means the MSB byte is the first stored in smallest address. The input is stream of unsigned char and the output is stream of unsigned char.

Packed to unpacked

(6) Results

a. Original Spectrum and Waveform

result_original

b. Encoded Spectrum and Waveform

result_decoded

c. Decoded Spectrum and Waveform

result_encoded

Leave a Reply