Learn R Programming

gmwm (version 2.0.0)

gen_qn: Generate a Quantisation Noise (QN) sequence

Description

Generate an QN sequence given q2

Usage

gen_qn(N, q2 = 0.1)

Arguments

N
An integer for signal length.
q2
A double that contains autocorrection.

Value

A vec containing the QN process.

Details

To generate the quantisation noise, we follow this recipe: First, we generate using a random uniform distribution: $$U_k^*\sim U\left[ {0,1} \right]$$

Then, we multiple the sequence by $sqrt(12)$ so: $${U_k} = \sqrt{12} U_k^*$$

Next, we find the derivative of $U_k$ $${{\dot U}_k} = \frac{{{U_{k + \Delta t}} - {U_k}}}{{\Delta t}}$$

In this case, we modify the derivative such that: $U_k^. * (delta)t = U_{k + (delta)*t} - U_k$

Thus, we end up with: $${x_k} = \sqrt Q {{\dot U}_k}\Delta t$$ $${x_k} = \sqrt Q \left( {{U_{k + 1}} - {U_k}} \right)$$

Examples

Run this code
gen_qn(10, 5)

Run the code above in your browser using DataLab