signal_windowing

This function handles signal windowing (segmentation) tasks, by splitting the original signal into segments of the same length.
7 Downloads
Updated 2 Nov 2023

View License

COPYRIGHT © Year: 2023
Holder: Simone Costantini
Affiliation: Dipartimento di Elettronica, Informazione e Bioingegneria (DEIB),
Politecnico di Milano, Milano, Italy
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  • Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
This software is provided by the copyright holders and contributors "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
================================================================================
Author's information:
Author: Simone Costantini, PhD candidate in Bioengineering
Dipartimento di Elettronica Informazione e Bioingegneria (DEIB)
Politecnico di Milano
Year: 2023
Email: simone.costantini@polimi.it
================================================================================
Function syntax: [time_win,sig_win,N_win] = signal_windowing(signal,fs,win_len,overlap,method)
Inputs:
  • signal: A (N,1) array containing the signal to be windowed, or a (N,2) array containing in the first column the time vector, and in the second column the signal
  • fs: {Integer scalar} Sample frequency of the signal.
  • win_len: {Integer scalar} Length (in seconds) of the window.
  • overlap: Overlap ratio. It must be a float scalar in range [0,1)
  • method: Select among 'head', 'centered', and 'tail': 'head' allows the windowing starting from the very first sample of the signal. The tail surplus will be discarded; 'centered' allows the windowing by discarding half of the surplus from the signal head, and the other half from the signal tail; 'tail' allows the windowing by discarding the surplus from the signal head.
Outputs:
  • time_win: Cell array containing the windowed time vectors
  • sig_win: Cell array containing the windowed signal
  • N_win: Number of windows generated
================================================================================

Cite As

Simone Costantini (2024). signal_windowing (https://www.mathworks.com/matlabcentral/fileexchange/154491-signal_windowing), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0