view aim-mat/tools/@fsignal/fsignal.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
% method of class @fsignal (derived from @signal)
% 
%   INPUT VALUES:
%  
%   RETURN VALUE:
%
% 
% (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 f=fsignal(laenge,samplerate)

start_time=0;
unit_y='amplitude (dB)';
unit_x='Frequency (Hz)';
name='generic Frequencysignal';
if nargin< 2
    samplerate=1000;
end

% Konstruktor kann auch ein Vektor sein, dann wird direkt konstruiert.
lang=size(laenge,1);
if size(laenge,2)>1 %Benutzer hat falschen Vektor (Zeilenvektor) eingegeben
    lang=size(laenge,2);
    laenge=laenge';
end
if lang>1 % AHA! Ein Vektor
    f.werte=laenge;
    nr_points=lang;
else
    nr_points=laenge;
    f.werte=zeros(round(nr_points),1);
end

f.max_fre=samplerate;
f.df=samplerate/nr_points;     %frequenzabstand

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

f=class(f,'fsignal',sig);