np_mc_nss_analysis — Multi channel non stationnary signal analysis using short term fft
[signals_energy,signals_dispersion,inout_gains,inout_coherences] = np_mc_nss_analysis(signals,frequency_bands [,options])
a N
by Nt
array with
as many rows as signals. The first row must be the
output signal and the next ones
the inputs.
a M
by 2 array, each row [fmin
fmax]
specifies the frequency range to be
studied.
a struct with fields:
sectionstep
must be less or
equal to sectionlength
. Overlap
is sectionlength-sectionstep
.
a N
by P
by M
3D
array. signals_energy(k,:,i)
gives the
energy of the signal signals(k,:)
in the frequency
band [frequency_bands(i,1)
frequency_bands(i,2)]
.
a tlist with fields:
N
by
P
by M
3D
array. signals_dispersion.fmin(k,:,i)
gives the frequency around which the dispersion is
minimal for the signal
signals(k,:)
in the frequency band
[frequency_bands(i,1)
frequency_bands(i,2)]
.
N
by
P
by M
3D
array. signals_dispersion.pmin(k,:,i)
gives the value of the SPSD at the frequency of
minimal dispersion for the signal
signals(k,:)
in the frequency band
[frequency_bands(i,1)
frequency_bands(i,2)]
.
N
by
P
by M
3D array
which values are in
[0;1]
. signals_dispersion.dmin(k,:,i)
gives the value of the minimal dispersion for the
signal signals(k,:)
in the
frequency band [frequency_bands(i,1)
frequency_bands(i,2)]
. Dispersion value is
zero when the signal is merely a sinusoide, only one
components, whereas is 1 if the spectra is completely
spread, so there isn't a principal component.
N-1
by P
by
M
3D
array. inout_gains(k,:,i)
gives the
signals(k+1,:)
to
signals(1,:)
transfer function gain in
the frequency band [frequency_bands(i,1)
frequency_bands(i,2)]
.
N-1
by P
by
M
3D
array. inout_gains(k,:,i)
gives the
signals(k+1,:)
to
signals(1,:)
coherence in
the frequency band [frequency_bands(i,1)
frequency_bands(i,2)]
.
This function performs non parametric multi channel non stationnary signal analysis using short-time Fourier transform (STFT) by which the time record is multiplied by a sliding window and the FT of the consecutive windowed segments are computed resulting in a series of local spectra.
This analysis can be done simultaneously on several frequency ranges.
Create signals
Tmax=90;//final time fs=20;//sampling frequency Hz f0=0.5;//base frequency Hz // Time instants t=0:1/fs:Tmax;N=size(t,'*'); n=round(N/2) //output signal f1=1.2*f0; out=[2*sin(2*%pi*f0*t(1:n)) sin(2*%pi*f1*t(n+1:$))]+2d-2*rand(t); // Input signal f2=1.4*f0; in=[sin(2*%pi*f0*t(1:n)) sin(2*%pi*f2*t(n+1:$))];
Perform analysis
sl=300; //section length clear options options.sectionlength=sl; options.sectionstep=sl/2; //50% overlaping options.smoothwindowlength=5; options.minimalcoherence=0.5; fbands=[0.5*f0 2.5*f0]/fs; [energy,dispersion,inout_gain,inout_coherence]=np_mc_nss_analysis([out;in],fbands,options); nr=size(energy,2); tr=(1:nr)*sl/(2*fs);
Drawings
o=0.05; //reserve space for title h=1/3; clf; a=newaxes();a.axes_bounds=[0,0,1,h];a.margins(3)=0.25; plot(t,[in;out]');legend(['in','out']);title("signals") a=newaxes();a.axes_bounds=[0,h,1,h];;a.margins(3)=0.25; plot(tr,inout_gain); title("in -> out gain") a=newaxes();a.axes_bounds=[0,2*h,1,h];a.margins(3)=0.25; plot(tr,inout_coherence); xlabel('time');title("in/out coherence")