Search…
⌃K
Links

Alien Voice

In this section we will implement the "alien voice" effect on the microcontroller. As shown in the Jupyter notebook, the alien voice effect is achieved simply by performing sinusoidal modulation on the input signal in order to shift the voice spectrum up in frequency.
Given a modulation frequency
fcf_{c}
(in Hz) and an input sample
x[n]x[n]
we can compute each output sample
y[n]y[n]
instantaneously as:
y[n]=x[n]cos(2πfcFsn)=x[n]cos(ωcn),y[n] = x[n] \, \cos\left(2\pi \frac{f_{c}}{F_s} n \right) = x[n] \, \cos(\omega_c n),
where
FsF_s
is the system's sampling frequency (in Hz). The modulation frequency must be kept small in order to preserve intelligibility; still, the resulting signal will be affected by aliasing and other artifacts that we cannot really control.
As mentioned in the Jupyter notebook, this voice transformer is great for real-time applications as it requires only a single multiplication per sample. This means that, compared to the passthrough project, we will not have to write too much new code. But the devil, as they say, is in the details!
. . . . . . . . . + .
. . : . .. :. .___---------___.
. . . . :.:. _".^ .^ ^. '.. :"-_. .
. : . . .:../: . .^ :.:\.
. . :: +. :.:/: . . . . . .:\
. : . . _ :::/: . ^ . . .:\
.. . . . - : :.:./. . .:\
. . . :..|: . . ^. .:|
. . : : ..|| . . . !:|
. . . . ::. ::\( . :)/
. . : . : .:.|. ###### .#######::|
:.. . :- : .: ::|.####### ..########:|
. . . .. . .. :\ ######## :######## :/
. .+ :: : -.:\ ######## . ########.:/
. .+ . . . . :.:\. ####### #######..:/
:: . . . . ::.:..:.\ . . ..:/
. . . .. : -::::.\. | | . .:/
. : . . .-:.":.::.\ ..:/
. -. . . . .: .:::.:.\. .:/
. . . : : ....::_:..:\ ___. :/
. . . .:. .. . .: :.:.:\ :/
+ . . : . ::. :.:. .:.|\ .:/|
. + . . ...:: ..| --.:|
. . . . . . . ... :..:.."( ..)"
. . . : . .: ::/ . .::\
Source.