Thread Subject: animation with movie function

Subject: animation with movie function

From: Clement Lim

Date: 1 Oct, 2009 01:17:03

Message: 1 of 1

Hi,

I wanted to use the movie function to create an animation effect in the waterfall plot and spectrogram from a music wav file. I wish to create a visual effect such that the waterfall plot and spectrogram will "move" while the music is being play. However, the below code done by me is simply unable to do so. When the program is run, it first show 2 plots, with the below plot showing some meaningless data. The next 2 plots show stationary spectrogram and waterfall plot.

Hope you can assist. Tks alot


[filename, pathname] = uigetfile('*.*', 'Pick any file');
[y, fs, nbits] = wavread(filename);
disp('Playing at the original sample rate.');
sound(y, fs);
disp(fs);
subplot(311)
spectrogram(y);

Y = fft(y);
[S,S,T,P]=spectrogram(y(:,1));
 subplot(2,1,1);
 spectrogram(y(:,1));
 title('Spectrogram');
 subplot(2,1,2);
 for k = 1:16
 plot(Y)
axis equal
 M(k) = getframe;
 end
 arg={S,T,10*log10(abs([P.'])+eps)};
waterfall(arg{:});
 colormap(jet(256));
 title('Waterfall Plot');

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
code Sprinceana 1 Oct, 2009 02:46:29
animation Sprinceana 1 Oct, 2009 02:46:22
rssFeed for this Thread

Contact us at files@mathworks.com