This tutorial will show you how to get started with processing and analyzing your operational measurement data in the VIBES Toolbox.
We will start by converting the data from the operational measurement, in this case an Electric Wide-Open-Throttle (ELWOT) measurement on a BMW i3, to a vibes.TimeSeries object for easy analysis.
The measurement is imported from a PAK2Mat file format using the static constructor vibes.TimeSeries.fromPak, which extracts a lot of channel and meta data fields that describe the actual time data array.
fn = vibes.fullfile(‘VIBES,Examples,Datasets’,’pak’,’i3Measurement.mat’);
TS = vibes.TimeSeries.fromPak(fn);
The vibes.TimeSeries object has three Channels. You can inspect the channels and plot the data directly using the methods of the vibes.TimeSeries class.
% The measurement was performed with a sampling frequency of 48 kHz over a
% time of 32.3 seconds.
There is a method for plotting the data directly, as well as for plotting (A-weighted) sum levels of the time data. We will plot for the third channel, which is the sound pressure measured in the cabin and use A-weighting to get correct dB(A) peak levels.
% Apply A-weighting and set scaling to dB(A)
Figure 3-1: Plotting time data and A-weighted sum levels of the time data
Before converting to the frequency domain, we will convert the vibes.TimeSeries object to a vibes.TimeBlocks object. We will use blocks of 0.25 seconds in length starting 0.1 seconds apart. This means the overlap factor is 2.5x. We use the complete time interval.
time = ;
length = 0.25;
overlap = 2.5;
% Create time blocks
TB = TS.toTimeBlocks(time,length,overlap);
% Check the first blocks and verify the 0.1 second intervals
% You can plot both acceleration channels in one figure using the following
% channel selection:
ch = TB.Channels.select(‘Quantity’,’Acceleration’);
% Plot a time block; the labels are provided automatically
vibes.figure(‘Time Blocks: Acceleration’);
legend location NE
Figure 3-2: Plotting a time block
Converting to the frequency domain means calculating a Fourier transform by means of FFT. The parameters for the FFT operation may have a high impact on the validity of the resulting spectra, which will be shown in this section.
We will first use a Hann window and default FFT settings.
wdw = ‘hann’;
% Create with default FFT settings based on the block length
FB = TB.toFreqBlocks(wdw);
Create a waterfall diagram for quick inspection using the vibes.FreqBlocks/plot3d method. Note that this method is not as configurable as the vibes.FreqBlocks/plot method, which will be demonstrated later.
vibes.figure(‘Frequency Blocks: Waterfall diagram’);
% Adjust the axis of the color bar
Figure 3-3: Plotting a frequency block
Let us now investigate the effect of block length, overlap and zero-padding. We focus on a single time block at 10.3 seconds.
b_vmax = ‘10.3sec’;
% Create spectra with 1 Hz frequency spacing, adjusting the effective
% block length to 1 second. This results in so-called zero-padding.
df = 1;
FB_1Hz = TB.toFreqBlocks(wdw,0:df:16000);
% Also create spectra with 10 Hz frequency spacing. Observe the warning
% that is thrown about negative zero-padding.
df = 10;
FB_10Hz = TB.toFreqBlocks(wdw,0:df:16000);
frq = [4500 5000];
% Define a single parameterised label using the ‘<…>’ elements to reference
% to the fields in obj.Parameters.* and obj.*
lbl = ‘<df>Hz spacing (ZP-factor <Window.ZeroPadding>x)’;
vibes.figure(‘Frequency Blocks: Spectra’); clf
FB.plot(1,b_vmax,frq,’Label’,lbl,’Style’,’2k–‘); hold on
Figure 3-4: Effect of block length, overlap and zero-padding
Notice how the zero-padding factors > 1 result in correct amplitudes, while the 10Hz spacing underestimates the amplitudes. This is because the first two use the full time blocks for the FFT operation with respectively no padding and 3x padding, while the third setting forces the FFT to be computed for cut-off blocks at 40% of the length.
Now plot sum levels for a selected frequency region, to see how this would have affected the estimation.
frq_sum = [4650 4725];
Figure 3-5: Sum level comparison
Still haven't found what you are looking for?
Contact our support team or call us on +31 85 744 09 70