From d6e8cfd86be242d0a1a09a1ef7d8b7f3d12af795 Mon Sep 17 00:00:00 2001 From: ttt Date: Thu, 6 Dec 2018 13:42:14 +0530 Subject: code by jitendra and added more test4.sce --- help/en_US/medfilt1.xml | 103 +++++++++++++----------------------------------- 1 file changed, 28 insertions(+), 75 deletions(-) (limited to 'help/en_US/medfilt1.xml') diff --git a/help/en_US/medfilt1.xml b/help/en_US/medfilt1.xml index 2760fe9..ffa7490 100644 --- a/help/en_US/medfilt1.xml +++ b/help/en_US/medfilt1.xml @@ -18,107 +18,60 @@ medfilt1 1D median filtering - Calling Sequence - y = medfilt1(x) - y = medfilt1(x, n) - y = medfilt1(x, n, dim) - y = medfitl1(__, nanflag, padding) - Description y = medfilt1(x) - -Applies a 3rd order 1-dimensional median filter to input x along the -first non-zero dimension. - The function appropriately pads the signal +Applies a 3rd order 1-dimensional median filter to input x along the +first non-zero dimension. The function appropriately pads the signal with zeros at the endings. For a segment, a median is calculated as the middle value (average of two middle values) for odd number -number (even number) of data points. - -y = medfilt1(x,n) -Applies a nth order 1-dimensional median filter. - -y = medfilt1(x,n,dim) -Applies the median filter along the n-th dimension - -y = medfilt1(__, nanflag, padding) -nanflag specifies how NaN values are treated. padding specifies the -type of filtering to be performed at the signal edges. - - +number (even number) of data points. +y = medfilt1(x,n) +Applies a nth order 1-dimensional median filter. +y = medfilt1(x,n,dim) +Applies the median filter along the n-th dimension +y = medfilt1(__, nanflag, padding) +nanflag specifies how NaN values are treated. padding specifies the +type of filtering to be performed at the signal edges. + + + Parameters x: - int | double Input signal. + int | double n: - positive integer, scalar - Filter order. - Defaults to 3.The order of the median filter. Must be less than - (length of the signal) where signals are 1D vectors along the - dimension of x to be filtered + positive integer scalar dim: - positive integer scalar - Dimension to filter along. - Defaults to first non-singleton dimension of x + positive integer scalar nanflag: - 'includenan' (default) | 'omitnan' - NaN condition. - * includenan: Filtering such that the median of any segment containing a NaN is also a NaN. - * omitnan: Filtering with NaNs omitted in each segment. If a segment contains all NaNs, the result is NaN - - + 'includenan' (default) | 'omitnan' + * includenan: + Filtering such that the median of any segment + * omitnan: + Filtering with NaNs omitted in each segment. If a segment y: - int | double - The filtered signal. - y has the same size as x + int | double + Examples : + Noise supression using 10th order (n =10) median filtering + t = 0: + 1/fs:1; + Output : + - - - - - Examples - - - -//Generate a sinusoidal signal sampled for 1 second at 100 Hz. Add a higher-frequency sinusoid to simulate noise. -fs = 100; -t = 0:1/fs:1; -x = sin(2*%pi*t*3)+0.25*sin(2*%pi*t*40); - -//Use a 10th-order median filter to smooth the signal. Plot the result. -y = medfilt1(x,10); -plot(t,x,t,y) -legend('Original','Filtered'); -y = round(y*10000)/10000; -y = y' - - - -- cgit