MATLAB: Plotting ECG signals

ecgekgfilterfrequencyplotplottingtime

hi, can anyone teach me how to plot an ECG signals in time domain and transforming it into frequency domain in MATLAB? this ECG signals is corrupted by noise, therefore, a stable filter needs to be used. How to design this filter that can filter out the noise and plotting its magnitude response as well??
please help me, your help is much appreciated.
PS, where to find a corrupted ECG signals?? any links or help??

Best Answer

doc fft %the documentation example is very good
Very simple example how to add noise to a wave:
t=0:0.1:10; %from 0 to 10 seconds, sampling 0.1 seconds
y=sin(t); %measured amplitude
n=0.1*rand(1,numel(t)); %noise to add
plot(x,y+n)