12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

You can see that over the 8 time steps, the arrival direction <strong>of</strong> the soundhas changed from −45 degrees to 30 degrees, <strong>and</strong> the two sources alwayscome from the same direction, strengthening our notion that the two arein fact harmonics <strong>of</strong> the same source. Let us look at the time-frequency<strong>and</strong> time-angle distributions <strong>of</strong> this data. The above output <strong>of</strong> the whoscomm<strong>and</strong> shows that the row index <strong>of</strong> data corresponds to the differentangles, so if we calculate the mean over the rows we will be left with atime-frequency distribution:>> time_freq = mean(data);>> size(time_freq)ans =1 1039We are left with a 1 × 103 × 9 matrix <strong>of</strong> averages over the 128 arrivalangles. To plot the results we have to squeeze this to a two-dimensional103 × 9 matrix:time_freq = squeeze(mean(data));imagesc(t,f,time_freq)axis xyxlabel(’Time, s’)ylabel(’Frequency, Hz’)The frequency varies slightly with time. By averaging the rows <strong>of</strong> thedata matrix we can get a similar plot <strong>of</strong> the variation <strong>of</strong> arrival anglewith time:time_angle = squeeze(mean(data,2));imagesc(t,th,time_angle)axis xyxlabel(’Time, s’)ylabel(’Arrival angle, degrees’)29.5 Multidimensional Cell ArraysMultidimensional cell arrays are just like ordinary multidimensionalarrays, except that the cells can contain not only numbers, but vectors,c○ 2000 by CRC Press LLC

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

Saved successfully!

Ooh no, something went wrong!