Matlab provides a user-friendly programming environment with great flexibility, very well-suited to modeling, analyzing physiological data and developing biomedical signal processing algorithms. In this lab we will become familiar with handling and plotting discrete-time signals in the Matlab environment – both theoretical signals we generate with equations, and real data.
Part I: mathematical function plotting
Say you want to generate a sinusoid of a certain frequency, and plot it. Matlab, not being a live thinking
entity, has no clue what you want to do so you need to specify EVERYTHING to it.
Let’s say you want to plot a 5-Hz sinusoid over a 2-second time frame beginning at 0. We want it to have an
amplitude of 2 and have a cosine phase (begins at its peak/maximum at time 0). We are trying to construct
a signal that is a function of time, so we should therefore define ‘time.’ And it’s a discrete-time signal so we
need a value of the signal only at discrete – usually evenly-spaced – times. Let’s choose a ‘sampling rate’ of
200 Hz, in other words, choose to evaluate the function in discrete 5-ms steps:
Get Free Quote!
393 Experts Online