I'm attempting to clean impulse noise from a wave file in matlab. the file is two channels, about 7 million points in each channel. What I wish to do is keep points, that are below my trigger levels, and delete points (in both channels simultaneously) that are above the trigger levels for either channel. Code is below(adsbygoogle = window.adsbygoogle || []).push({});

for x = 1:1:lnth

if abs(sig(i,1)) > level1 || abs(sig(i,2)) > level2

sig(i,:) = [];

else

i=i+1;

end

end

The code works and does what I want it to. The problem is that its very, very slow. Is there a way I can vectorize the code to make it faster? Or does anyone have any suggestions for a smarter algorithim (I've had some ideas, but havn't bothered to code any of them)

Thanks!

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab noise cleaning

Loading...

Similar Threads for Matlab noise cleaning |
---|

MATLAB MATLAB: forces acting on an object |

MATLAB Matlab histogram |

MATLAB Sovling Bernoulli's differential equation in matlab? |

MATLAB Matlab-like software |

MATLAB Matlab data into bins |

**Physics Forums | Science Articles, Homework Help, Discussion**