pulse_sine.m

来自「matlab中噪声模型」· M 代码 · 共 42 行

M
42
字号
function art = pulse_sine(lenArtS, sampF, freqArt, ampArt)%% art = pulse_sine(lenArtS, sampF, freqArt, ampArt);%% generate a sine pulse of length lenArtS at freqArt with a sampling% frequency of freqArt and a normalise amplitude of ampArt.% Requires sine_art.m%% G Clifford 2003 gari@ieee.org [GNU GPL]if nargin<4 ampArt   = 0.5; % normalised amplitude of art endif nargin<3 freqArt = 5; % hzendif nargin<2 sampF = 256;endif nargin<1 lenArtS  = 0.75; % length in secondsendlenArt   = round(sampF*lenArtS);% length in samplesy= sine_art(lenArt,freqArt);  % generate sine wave% generate a half sine wave to modulate itx = sine_art(lenArt, (sampF*lenArtS)/(2*lenArt));%x = sine_art(lenArt, lenArtS/2); art = (x.*y)*ampArt;          % modulate and scaleif nargin<1figure;subplot(2,3,1)     plot(y);subplot(2,3,2)     plot(x);subplot(2,3,3)     plot(art);subplot(2,1,2)end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?