Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello experts, I got this piece of code for the lowpass filter on the internet, my question is what should I change in the code

image text in transcribed

Hello experts,

I got this piece of code for the lowpass filter on the internet, my question is what should I change in the code if I have two variables named A and B imported from an Excel file(containing a large set of data) into MATLAB in order to filter out the noise in the signal?

Thank you in advance

>> Fs = 100; >> T = 1/Fs; >> t = 0:T:1-T; >> S = sin(2*pi*10*t); >> noise = 0.5*randn (size(t)); >> x = s + noise; >> plot (x) >> shg >> plot (x) d = designfilt('lowpassfir', 'Filterorder', 5, 'Cutofffrequency', 11, SampleRate', Fs); >> y = filter (d, x); >> plot (y) >> plot(x); hold on; plot (y) >> d = designfilt('lowpassfir', 'Filterorder', 8, 'CutoffFrequency', 10, 'SampleRate', Fs); >> y = filter (d, x); >> plot (x); hold on; plot (y) >> plot (x); hold on; plot (y) >> y = filtfilt(d, x); >> plot (x); hold on; plot(y) >> mean(y) >> Fs = 100; >> T = 1/Fs; >> t = 0:T:1-T; >> S = sin(2*pi*10*t); >> noise = 0.5*randn (size(t)); >> x = s + noise; >> plot (x) >> shg >> plot (x) d = designfilt('lowpassfir', 'Filterorder', 5, 'Cutofffrequency', 11, SampleRate', Fs); >> y = filter (d, x); >> plot (y) >> plot(x); hold on; plot (y) >> d = designfilt('lowpassfir', 'Filterorder', 8, 'CutoffFrequency', 10, 'SampleRate', Fs); >> y = filter (d, x); >> plot (x); hold on; plot (y) >> plot (x); hold on; plot (y) >> y = filtfilt(d, x); >> plot (x); hold on; plot(y) >> mean(y)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions