%% Add Member to Labeled Signal Set
% Load a labeled signal set containing recordings of whale songs.

load whales
lss

%
% Retrieve the second member of the set and plot it.

[song,tinfo] = getSignal(lss,2);

t = (0:length(song)-1)/tinfo.SampleRate;

plot(t,song)

% Remove the first and last seconds of the retrieved signal.

song2 = song(t>1 & t<t(end)-1);
t2 = (0:length(song2)-1)/tinfo.SampleRate;

plot(t2,song2)

% Add the shorter signal as a new member of the labeled set.

addMembers(lss,song2)
lss

% Flip the shorter signal upside-down and add it as a new member of the labeled set. Specify that the new member is sampled at 1 kHz.

addMembers(lss,flipud(song2),1000)
lss.SampleRate

% Copyright 2018 The MathWorks, Inc.