FREEVIB (Matlab)

function [z,A,f0,h,Ayd]=freevib(y,Fs,stype);
%
% Function FREEVIB (Free Vibration Modal Analysis)
% It determines the instantaneous modal parameters
% and force characteristics of a symmetric
% linear and non-linear vibration SDOF system.
% Input:
% Vector y is a vibration signal in time domain,
% stype is a signal type, e.g. displacement, velocity, or acceleration.
% Fs is the sampling frequency [Hz] %
% Output:
% z – displacement, A – envelope, f0 – natural frequency [Hz],
% h – damping coefficient [1/sec], Ayd – envelope of the velocity
%m23_1
% y” + 2*h*y’ +(2*pi*f0)^2*y = 0
%
% EXAMPLE:
% [z, A, f0, h, Ayd]=freevib(y,1000,’d’);
%
% LIMITATIONS:
% The sampling frequency Fs has to be in the range Fs=(10-100)*f0.
% The minimum of points in time domain is 3*230+1.
%
% © 2011 Michael Feldman
% For use with the book “HILBERT TRANSFORM APPLICATION
% IN MECHANICAL VIBRATION”, John Wiley & Sons, 2011

%N=230; % The filters lengthm23_2
if length(y)<=3*230+1, error(‘The length of the signal y must be more than three times the filter order’),end;
if nargin0);ff2=zeros(length(y),1);
ff2(ind_ffi)=sqrt(ffi(ind_ffi))./2/pi;FRF=[ff1 ff2]; % Freqyency Response Function

subplot(111);
plot(FRF(pp,:),A(pp),’r–‘,’LineWidth’,1);hold on
plot(f0(pp),A(pp),’b’,’LineWidth’,2);
xlabel(‘Frequecy, Hz’);ylabel(‘Amplitude’);
title([‘Back-Bone, FRF’]);
grid on;

% Static force calculation
figure(3);set(3,’Position’,[509 42 482 284]);

iel=find(y > 0.98*A & y 0.97*A & y < 1.03*A);m23_3
iel(iel=pp(length(pp)))=[];
ifr(ifr=pp(length(pp)))=[];

fofr=2*h(ifr).*Ayd(ifr); % Friction Force
foel=4*(pi*f0(iel)).^2.*A(iel); % Elastic force

subplot(121);
plot([-A(iel) A(iel)],[-foel foel],’k.’); hold on
plot([-A(iel) A(iel)],[-foel foel],’g’);
title(‘Elastic Static Force’);
ylabel(‘Elastic Force’); xlabel(‘Displacement’)
grid on;
hold off

subplot(122);
plot([-Ayd(ifr) Ayd(ifr)],[-fofr fofr],’k.’); hold on
plot([-Ayd(ifr) Ayd(ifr)],[-fofr fofr],’m’);
title(‘Friction Force’);
xlabel(‘Velocity’);ylabel(‘Friction Force’)
grid on;
hold off;

returrn

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

load duffrd
[z,A,f0,h,Ayd]=freevib(y,Fs,’d’);
plfree(z,A,f0,h,Ayd); %