How to remove Noise using histogram In Matlab

Hello Everyone, i hope you are doing well. I have the following data in which I have some noise. I want to remove the Noise using Histogram or any other Method. I have attached the picture below which is the noise.
How can i do that?

답변 (1개)

Abderrahim. B
Abderrahim. B 2022년 8월 28일
Hi!
Below is a workflow based on groupcounts function:
clear
load noisydata.mat
figure
subplot(211)
plot(dataset, 'o')
title("noisy data")
% Filtering based groupcounts
[GC, GR] = groupcounts(dataset) ;
denoisedData = dataset(ismember(dataset, GR(GC>10))) ; % group that has count less than 10 will be removed
subplot(212)
plot(denoisedData, 'o')
title("denoised data")
Hope this helps

댓글 수: 14

@Issa Still there is noise as you can see the following Imaage
Hi !
I recommend to use a slider to vary countThresh variable.
clear
load noisydata.mat
figure
subplot(211)
plot(dataset, 'o')
title("noisy data")
% Filtering based groupcounts
[GC, GR] = groupcounts(dataset) ;
countThresh = 20 ; % change this untill you see that the data is fully denoised
denoisedData = dataset(ismember(dataset, GR(GC>countThresh))) ; % group that has count less than 10 will be removed
subplot(212)
plot(denoisedData, 'o')
title("denoised data")
@Issa Getting the following Error While using this function
Error using cell/ismember (line 34)
Input A of class double and input B of class cell must be cell arrays of character vectors, unless one is a character vector.
@Stephen john show your code. For me working just fine.
Here is the Dataset and your code it gives error
denoisedData is empty
[GC, GR] = groupcounts(Bindata) ;
countThresh = 30 ; % change this untill you see that the data is fully denoised
denoisedData = Bindata(ismember(Bindata, GR(GC>countThresh))) ;
Please show up what print executing the below command:
class Bindata
@Issa The Bindata is the array which contain data and class Bindata shows 'char'
Abderrahim. B
Abderrahim. B 2022년 8월 29일
편집: Abderrahim. B 2022년 8월 29일
Sorry wanted to write
whos Bindata
Maybe you can upload the data from where you got Bindata!
here is the data
Name Size Bytes Class Attributes
Bindata 503x1 4024 double
Check the attached mlx script also.
clear
load dataset.mat
figure
subplot(211)
plot(Bindata, 'o')
title("noisy data")
ylim([20 40])
xlim([0 600])
% Filtering based groupcounts
[GC, GR] = groupcounts(Bindata) ;
countThresh = 11 ; % change this untill you see that the data is fully denoised
denoisedData = Bindata(ismember(Bindata, GR(GC>countThresh))) ; % group that has count less than 10 will be removed
subplot(212)
plot(denoisedData, 'o')
title("denoised data")
ylim([20 40])
xlim([0 600])
Stephen john
Stephen john 2022년 8월 29일
편집: Stephen john 2022년 8월 29일
@Issa I need a uniform code which works on all datasets like that , In the above code of your I need to change the countThresh = 11 which is not a good way.
I understand, try other filtering methods. This method - based find groups count requires to set a threshold for filtering.
@Issa Can you help me with this using Histogram?

댓글을 달려면 로그인하십시오.

제품

릴리스

R2022a

질문:

2022년 8월 28일

댓글:

2022년 8월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by