0
$\begingroup$

I would like to hear how aliasing sounds like. How can I get this with Audacity?

(I was told that I should adjust the Fourier coefficients in Audacity. I have no idea where I can do so / how I should adjust them.)

$\endgroup$
  • $\begingroup$ I don't know how to do it in Audacity, but there's actually an audio sample in the wikipedia article. $\endgroup$ – Matt L. Nov 24 '14 at 16:42
  • $\begingroup$ I want to hear it on natural language. $\endgroup$ – Martin Thoma Nov 24 '14 at 16:46
  • $\begingroup$ A simple method would be to take a recording, throw away every other sample, and play it at half the sampling rate. Alternatively, set every other sample to zero, and play at the original sampling rate. $\endgroup$ – Matt L. Nov 24 '14 at 16:49
  • $\begingroup$ I don't think there's a way to do it in Audacity, it filters automatically $\endgroup$ – endolith Nov 24 '14 at 19:59
  • $\begingroup$ @endolith Do you know any other program that can do so (Python scripts are ok, too) $\endgroup$ – Martin Thoma Nov 24 '14 at 20:02
0
$\begingroup$

Here's a Python script that does what Matt L said:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Enforce aliasing by reducing an audio-file to every n'th frame."""

from scipy.io.wavfile import read, write


def main(inputFilename, outputFilename, n):
    rate, data = read(inputFilename)
    write(outputFilename, rate/n, data[::n])


if __name__ == "__main__":
    from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
    parser = ArgumentParser(description=__doc__,
                            formatter_class=ArgumentDefaultsHelpFormatter)
    parser.add_argument("-i", "--input", dest="inputfile",
                        help="input WAV file", metavar="FILE")
    parser.add_argument("-o", "--output", dest="outputfile",
                        help="output WAV file", metavar="FILE")
    parser.add_argument("-n",
                        dest="n", default=2, type=int,
                        help="every n'th frame gets played")
    args = parser.parse_args()
    main(args.inputfile, args.outputfile, args.n)

It might not be audible at factor = 2. Try other powers of 2.

$\endgroup$
  • 1
    $\begingroup$ Could the person who downvoted this answer please explain why? $\endgroup$ – Martin Thoma Nov 25 '14 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.