% [b,a] = butter(5,20/(fs/2),'low');
% smoothData = filtfilt(b,a,abs(hilbert(data)));
% plot(smoothData)
p = fft(data);
ls = length(p);
x=abs(p((1:ceil(ls/2))));
plot(hwin2,x)
% if min(size(data))>1
% error('Can''t load stereo data')
% end
end
%is one of the function to call back for one of my uicontrol to load a wavfile and display the timewaveform (together with the envelope ) , frequency domain (spectrum) as well .
but in your program i think that is the max height for first graph
because you have plot(tdata,2*smoothData) so x is bottom and 2*smoothData is top
there fore x axis is 1:ldata and y axis is -2*(max(length(b)-1,length(a)-1)):2*(max(length(b)-1,length(a)-1))
i did. its same thing your doing except your version has n data points instead of time on bottoms. right?
well attach your wav file if can or upload it to a website and post link, pm, something, email cause i have no idea what your talking about without running the program. never done this before