4.3.12 Sound Processing

Summary

Origin features some useful signal processing tools, such as smoothing, FFT filtering, and spectral analysis tools like the Fast Fourier Transform (FFT) . These can be useful for performing sound analysis. This tutorial will remove a specific noise from an audio signal (.WAV file) based on the spectral range of the noise.

Minimum Origin Version Required: Origin 9 SR0

What You Will Learn

  1. Import a sound file (.WAV) into Origin.
  2. How to view sampling interval information.
  3. How to use FFT gadget to check the frequency spectra of a signal.
  4. Perform FFT filter on the audio signal.
  5. Export a filtered signal as a .WAV file.

Steps

In this tutorial, we will use "Origin8 Message.wav" and "Dial Tone.wav" which can be found under the subfolder "\Samples\Signal Processing\" of the Origin installation folder.

Play the sound file "Origin 8 Message.wav" and you will hear a dial tone noise in the background. The 2nd file is a recording of the dial tone.

  1. Start Origin, and create a new project with an empty worksheet in a workbook.
  2. Select menu File: Import: Sound (WAV)... to open the Sound dialog. (Hint: if this menu item is not shown, select menu File: Import: Customize... to open the Import Menu Customization dialog to add it.) Navigate to the "\Samples\Signal Processing\" folder and double click "Origin 8 Message.wav" and "Dial Tone.wav" to add them to the import list. Make sure Show Options Dialog is checked and click OK.
    WAV Sound 01.png
  3. In the Import and Export: impWav dialog, click the triangle button to to the right of Dialog Theme, and select System Default from the context menu. Then expand Import Options node, change Multi-File (except 1st) Import Mode to Start New Sheets.
    WAV Sound 02.png
  4. Click OK to import the two sound files into two worksheets:
    WAV Sound 03.png
  5. In each worksheet, we can see the Sampling Interval has the same value of 2.26757E-5 (second). Click the i icon in the top left corner of the column and the Column additional information dialog pops up with the sampling interval information. Click OK to close this dialog.
    WAV Sound 04.png
  6. With Dial Tone worksheet activated, highlight column A, and select menu Plot: Line: Line to make a line plot.
    WAV Sound 05.png
  7. Using this graph, select menu Gadgets: FFT... to open the Data Exploration: addtool_curve_fft dialog. Using the default settings, click OK button to perform an FFT of the data and create the FFTPREVIEW graph with the results.
    WAV Sound 06.png
    WAV Sound 07.png
  8. Uncheck the Log Scale checkbox on the FFTPREVIEW graph, and then select menu Graph: Rescale to Show All to rescale the graph. We can see that the distribution of frequency is mainly under 2000 Hertz with the largest peaks being under 500 Hertz.
    WAV Sound 08.png
  9. Activate the worksheet Origin 8 Message and highlight column A. Select menu Analysis: Signal Processing: FFT Filters to open the Signal Processing: fft_filters dialog. In the dialog, change Recalculate to None, select High Pass for Filter Type, uncheck the Auto checkbox for Cutoff Frequency and change value to 500. Clear Keep DC Offset checkbox. We can auto preview the result by ticking the Auto Preview checkbox at the bottom, and the result will be shown in the right panel, which can be shown or hidden by using the button in the bottom right corner of the left panel.
    WAV Sound 09.png
    Note: If Recalculate is not None, the results need to be copied to new columns without the recalculate lock for changing the Data Type, see step 11 below.
  10. Click OK to generate the results. We can see that the filtered result is in floating point format. In order to create a new WAV file, we need to convert this to an integer format.
    WAV Sound 10.png
  11. Highlight column D (the filtered result column), and then choose Properties... item from the right-click context menu, to open the Column Properties dialog. In this dialog, expand Options node, set Format to Numeric, then change Data Type to Short(2). Click OK to apply these settings to column D and close this dialog.
    WAV Sound 11.png
  12. Keeping column D highlighted, select menu File: Export: Sound (WAV).... In the open dialog, enter a file name (such as Origin 8 Message_filtered.wav) and save to a familiar location. Make sure the Show Options Dialog checkbox is ticked.
  13. Click Save button and the Import and Export: expWAV dialog pops up. Clear the Auto checkbox for Column, and change it to 4.
    WAV Sound 12.png
    Note: The Column is specified for the Y column, and Origin will find its sampling interval if exists or its associated X column. If no X column or the X column is not even spacing, there will be error messages.
  14. Click OK to export column D as a wave file. Now you can play this wave file and hear that the dial tone has been removed. Note that information with the same spectra as the dial tone is also removed.