Sunteți pe pagina 1din 4

Measurement & Signal Processing

a+b
1. Try to prove that the mean of a uniform distribution is E ( X ) =
2

( b + a )( b − a ) = a + b
b
xdx x2
E  X  =  xP ( x ) dx = 
b b
= =
a a b − a 2 (b − a ) a 2 (b − a ) 2

(b − a )
2

2. And the corresponding variance will be Var ( X ) =


12
Var ( X ) = E ( X −  )  = E  X  − E  X  =  x P ( x ) dx −  2
2 2 b
2 2
  a

( a + b ) = 4a 2 + 4ab + 4b2 − 3a 2 + 6ab + 3b 2


b 2
x3
= −
3(b − a ) a 4 12 12

(a − b)
2

=
12
3. For the given signal (“Signal_stdDev.mat”), how many data points that the corresponding
standard deviations are greater than 3 (i.e., outliers)? Please mark them on the figure.
(A) About 9 points
(B) Figure:
4. For the given sensing data “SampleData8192.txt”, it is sampled with 8192Hz for 10sec. Try
to plot the raw data and find:
(A) Population Mean(population). (5%).

Population Mean :  = −2.776110−7

(B) Population Variance & Standard deviation. (5%).

Population Variance: Var  X  = 7.3196 10−7

Standard deviation: Var  X  = 8.556 10−4

(C) Draw the corresponding histogram with 50 equivalent intervals. Provide your
MATLAB program. (5%)
Code.
%% --- Question 4---- %%
Data2 = importdata('SampleData8192.txt');
FS = 12;
%%
t = 1 : length(Data2);
time = t/8192;
figure()
plot(time, Data2)
xlabel('Time(s)', 'fontsize', FS)
ylabel('Signal','fontsize', FS)
%%
mu = sum(Data2(:, 1))/length(t);
var = sum((Data2(:, 1) - mu).^2)/length(t);
std = sqrt(var);
%
interval = 50;
[counter, bin ] = hist(Data2, interval);
freq = counter/sum(counter);
%
figure
hist(Data2, interval)
xlabel('Bins', 'fontsize', FS)
ylabel('Count','fontsize', FS)
%
figure
bar(bin, freq)
xlabel('Standard deviation', 'fontsize', FS)
ylabel('Frequency','fontsize', FS)
5. For the give file“Data.mat”, the sampled data response is shown as follows. Please plot
the histogram(with 50 bars) & Gaussian distribution. Also determine the mean value 
and the standard deviation 
Sampled data reponse:

Mean value:  = 50.0385 Varience: Var  X  = 35.886 Standard Deviation:  = 5.9905

S-ar putea să vă placă și