Skip to content

sig.signal

Olivier Lartillot edited this page Nov 14, 2018 · 22 revisions

This operator basically loads waveform files, and displays and performs operations on the waveforms.

The output is a sig.Signal object.

Accepted input formats

  • file name: Make sure that you include the file extension when specifying the file name. sig.signal can read:

    • delimited text files: .txt, .dat, .csv (only numerical fields are taken into consideration)
    • spreadsheet files: .xls, .xlsb, .xlsm, .xlsx, .xltm, .xltx, .ods (only numerical fields are taken into consideration)
    • audio files: .wav, .ogg, .flac, .au, .aiff, .aif, .aifc, as well as .mp3, .m4a and .mp4 for Windows® 7 (or later), Macintosh, and Linux®
  • sig.Signal object: for further transformations.

    • The output of sig.signal is a sig.Signalobject, which can be further transformed by calling again sig.signal.
    • If you have Matlab arrays that you would like to import as signals, create a sig.Signal object. You can then call sig.signal to perform additional operations on your signal.
  • sig.design object

Transformation

  • sig.signal(…,‘Mix’) sums the multiple channels (for instance in a stereo track) into one single mono channel. This option can also be called by any other signal-based operator, such as sig.spectrum, etc.

  • sig.signal(…,‘Center’) centers the waveform.

  • sig.signal(…,‘Sampling’,r) resamples at sampling rate r (in Hz). It uses the resample function from Signal Processing Toolbox.

  • sig.signal(…,'Detrend',d) removes the trend from the signal, by setting all frequencies below d Hz to zeros. The high-pass filtering is carried out through FFT followed by IFFT. When 'Detrend' is toggled on, the default value for d is 0.01 Hz.

  • sig.signal(…,‘FWR’) performs a full wave rectification, by flipping the negative values into positive values (absolute values).

  • sig.signal(…,‘Frame’,…) decomposes into frames. Cf. sig.frame for an explanation of the arguments. Default parameters: same as in sig.frame, i.e., 50 ms and half-overlapping.

Extraction

  • sig.signal(…,‘Extract’,t1,t2,u) extracts the signal between the dates t1 and t2, expressed in the unit u. Possible units u = ‘s’ (seconds, by default) or u = ‘sp’ (sample index, starting from 1).

Alternative keyword: ‘Excerpt’.

  • sig.signal(…,‘Trim’) trims the pseudo-silence beginning and end off the audio file.

    • sig.signal(…,‘TrimThreshold’, t) specifies the trimming threshold t. Silent frames are frames with RMS energy below t times the medium RMS of the whole audio file. Default value: t = 0.06.

    • sig.signal(…, w) specifies where to trim. Possible keywords for w: ’BothEnds’ (default), ’JustStart’, ’JustEnd’.

  • sig.signal(…,‘Channel’,c) extracts the channels of index (or indices) c. c is either

    • a scalar (i.e., just one number), or
    • a raw vector of two numbers, indicating the first and last index of a series of indices, or
    • a column vector containing all indices to take into consideration.
  • sig.signal(…,‘FreqBand’,b) extracts the frequency bands of index (or indices) b. b follows the same convention as c above.

  • sig.signal(…,‘Point’,p) extracts the points index (or indices) p. p is either

    • a scalar (i.e., just one number), or
    • a vector containing all indices to take into consideration.
  • sig.signal(…,‘Dim’,d) extracts the dimension index (or indices) d. d is either

    • a scalar (i.e., just one number), or
    • a vector containing all indices to take into consideration.
Clone this wiki locally