function [f,t]=enframe(x,win,inc)
%ENFRAME split signal up into (overlapping) frames: one per row. [F,T]=(X,WIN,INC)
%
% F = ENFRAME(X,LEN) splits the vector X(:) up into
% frames. Each frame is of length LEN and occupies
% one row of the output matrix. The last few frames of X
% will be ignored if its length is not divisible by LEN.
% It is an error if X is shorter than LEN.
%
% F = ENFRAME(X,LEN,INC) has frames beginning at increments of INC
% The centre of frame I is X((I-1)*INC+(LEN+1)/2) for I=1,2,...
% The number of frames is fix((length(X)-LEN+INC)/INC)
%
% F = ENFRAME(X,WINDOW) or ENFRAME(X,WINDOW,INC) multiplies
% each frame by WINDOW(:)
%
% The second output argument, T, gives the time in samples at the centre
% of each frame. T=i corresponds to the time of sample X(i).
%
% Example of frame-based processing:
% INC=20 % set frame increment
% NW=INC*2 % oversample by a factor of 2 (4 is also often used)
% S=cos((0:NW*7)*6*pi/NW); % example input signal
% W=sqrt(hamming(NW+1)); W(end)=[]; % sqrt hamming window of period NW
% F=enframe(S,W,INC); % split into frames
% ... process frames ...
% X=overlapadd(F,W,INC); % reconstitute the time waveform (omit "X=" to plot waveform)
% Copyright (C) Mike Brookes 1997
% Version: $Id: enframe.m,v 1.7 2009/11/01 21:08:21 dmb Exp $
%
% VOICEBOX is a MATLAB toolbox for speech processing.
% Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You can obtain a copy of the GNU General Public License from
% http://www.gnu.org/copyleft/gpl.html or by writing to
% Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nx=length(x(:));
nwin=length(win);
if (nwin == 1)
len = win;
else
len = nwin;
end
if (nargin < 3)
inc = len;
end
nf = fix((nx-len+inc)/inc);
f=zeros(nf,len);
indf= inc*(0:(nf-1)).';
inds = (1:len);
f(:) = x(indf(:,ones(1,len))+inds(ones(nf,1),:));
if (nwin > 1)
w = win(:)';
f = f .* w(ones(nf,1),:);
end
if nargout>1
t=(1+len)/2+indf;
end

钱亚锋
- 粉丝: 108
- 资源: 1万+
最新资源
- AI生成散文【指令+教程】.rar
- 模拟芯片行业:从竞争格局到产业生态深度剖析及其未来前景展望
- AI写小说指令【指令+教程】.rar
- 本地部署并运行DeepSeekPDF
- 爆款短视频脚本文案【指令+教程】.rar
- 基于CNN-LSTM-Attention的多特征输入多因变量输出回归预测模型(Matlab 2021版,含详细注释及多种结果图展示),基于CNN-LSTM-Attention的多特征输入多因变量回归预
- Matlab多维度信号处理与预测:大型设备振动信号的检测、分类与预警系统研究,Matlab多维度信号处理与预测系统:大型设备振动信号的检测、分类与安全预警策略,Matlab多维度分析,信号处理,预测
- Linux常用命令,linux常用命PDF令
- deepseek 应该怎样提问.zip
- Deepseek+高效使用指南.zip
- Deepseek不好用,是你真的不会用啊!.zip
- 当我用 DeepSeek 学习、工作和玩,惊艳!含提问攻略、使用实例和心得.zip
- DeepSeek小白使用指南,99%+的人都不知道的使用技巧(建议收藏).zip
- DeepSeek最强使用攻略,放弃复杂提示词,直接提问效果反而更好?.zip
- 零基础使用DeepSeek高效提问技巧.zip
- 让你的DeepSeek能力翻倍的使用指南.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



评论2