view aim-mat/tools/@clicktrain/clicktrain.m @ 0:74dedb26614d

Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author tomwalters
date Fri, 20 May 2011 12:32:31 +0100
parents
children
line wrap: on
line source
% constructor of class @clicktrain (derived from @signal)
% parent class: @signal
% function ct=clicktrain([length],[samplerate],[frequency],[amplitude])
 
%   INPUT VALUES:
%       length: length of signal in seconds [default 1]
%       samplerate: samplerate in Hz (points per seconds) [default: 1000]
%       frequency: frequency in Hz [default: 100]
%       amplitude: clicks amplitude [default: 1]
%   RETURN VALUE:
% 		@signal-object
%
%
%
% (c) 2003-2008, University of Cambridge, Medical Research Council 
% Maintained by Tom Walters (tcw24@cam.ac.uk), written by Stefan Bleeck (stefan@bleeck.de)
% http://www.pdn.cam.ac.uk/cnbh/aim2006
% $Date: 2008-06-10 18:00:16 +0100 (Tue, 10 Jun 2008) $
% $Revision: 585 $



function ct=clicktrain(length,samplerate,frequency,amplitude)
% produces a clicktrain as a signal

if nargin < 4
    amplitude=1;
end
if nargin < 3
    frequency=100;
end
if nargin < 2
    samplerate=10000;
end
if nargin < 1
    length=1;
end

name= sprintf('Clicktrain with %5.2f Hz',frequency);
unit_y='amplitude';
unit_x='time (ms)';
start_time=0;

ctt.frequency=frequency;
ctt.amplitude=amplitude;

sig=signal(length,samplerate,name,unit_x,unit_y,start_time);

% f=class(struct([]),'fsignal',sig);
ct=class(ctt,'clicktrain',sig);

ct=generate(ct);