Matlab Signal processing

johndoe45

Joined Jan 30, 2010
364
i don't know. never tried it. but t(1) is initial time
and t(length(t)) is final time

variable could be x or anything so i don't know without seeing the function.

i think its n(1)
n(end) or n(length(n))

just try it and see if it gives you anything.
this is just how many points are taken. but to compute the time i wouldn't know

just look at the side and it has has how long the arrays or vectors are
will say like 1 x 100 which means one row with 100 columns. so 100 elements

fh=[0:Lh-1]/Lh-0.5

therefore x axis is from 0 to length(Hh)-1

so type length(Hh)-1 and returns final value

i don't know

check this site out
https://ccrma.stanford.edu/~jos/sasp/Comparison_use_hilbert_function.html
 
Last edited:

Thread Starter

BuriedMoon

Joined Mar 2, 2010
22
function [data,fs,smoothData] = Uload()

[filename, pathname] = uigetfile('*.wav','Select Data File');



if filename ~= 0

cd(pathname);

% Get data and sampling rate

[data,fs] = wavread([pathname filename]);

% length(data)
% fs
data = data/max(data:)));
hwin1 = subplot(221);
xlabel('Samples')
ylabel('Signal (Volts)')
ldata = length(data)
tdata = 1:ldata;
cdata = hilbert(data);
[b,a] = butter(5,20/(fs/2),'low');
smoothData = filtfilt(b,a,abs(hilbert(data)));
plot(tdata,2*smoothData,tdata,abs(cdata))
hwin2 = subplot(222);


% [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 .
 

johndoe45

Joined Jan 30, 2010
364
so output variables are these [data,fs,smoothData]

this is initial to final data points
tdata = 1:ldata;

so type ldata and will give you final pretty sure

can't even find fs=...... in that mess
 

johndoe45

Joined Jan 30, 2010
364
so you got it?

and its correct for sure?

cause it might be max(length(b)-1,length(a)-1)

check this out and look at NOTE PORTION IN RECTANGULAR BOX!!!!!!!!!!!!!!!!!!
http://www.mathworks.com/access/helpdesk/help/toolbox/signal/filtfilt.html

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))
 

johndoe45

Joined Jan 30, 2010
364
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
 

johndoe45

Joined Jan 30, 2010
364
you send it to me yet? i think i sent you my email like 3 times cause doesn't show up under my sent messages

when is this due. i'm tired. if can't figure it out in next ten minutes i'm probably going to bed.
 
Top