13.07.2015 Views

Advance Modeling of a Skid-Steering Mobile Robot for Remote ...

Advance Modeling of a Skid-Steering Mobile Robot for Remote ...

Advance Modeling of a Skid-Steering Mobile Robot for Remote ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendixes 10111 % compute fft <strong>of</strong> dataRaw12 [dataRawFFT,freq] = computeFFT(dataRaw,tRange);1314 % eventually trans<strong>for</strong>m the data from voltage to acceleration15 if accOpt == 11617 %dataFilt = 3.4*9.8/5*(dataRaw−repmat(abs(dataRawFFT(1,:)),rData,1));18 dataFilt = 3.4*9.8/5*(dataRaw−2.6);19 [dataFiltFFT,freq] = computeFFT(dataFilt,tRange);2021 data = dataFilt;22 dataFFT = dataFiltFFT;2324 else25 data = dataRaw;26 dataFFT = dataRawFFT;27 end2829 % eventually plot the data and its FFT30 if plotOpt ˜= 031 plotData(data,time,dataFFT,freq,fileName,plotOpt,fRange);32 end1 function dataFilt = filterData(data,type,filterType,order,fRange)23 [rData,cData] = size(data);4 Fs = 1000; % Sampling Frequency5 N = order; % Order67 %% Design the filter89 if strcmp(type,’low’)1011 Fc = fRange(2); % Cut<strong>of</strong>f Frequency1213 % Construct an FDESIGN object and call its ’filterType’ method.14 h = fdesign.lowpass(’N,F3dB’, N, Fc, Fs);15 Hd = design(h,filterType);1617 elseif strcmp(type,’band’)1819 Fc1 = fRange(1); % First Cut<strong>of</strong>f Frequency20 Fc2 = fRange(2); % Second Cut<strong>of</strong>f Frequency2122 % Construct an FDESIGN object and call its ’filterType’ method.23 h = fdesign.bandpass(’N,F3dB1,F3dB2’, N, Fc1, Fc2, Fs);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!