Professional Documents
Culture Documents
Fundamentals of Signals
2010 Trity Technologies Sdn Bhd. All Rights Reserved
2-1
Fundamental of Signals
The scope of signal processing has grown so broad as to obviate a perfect and precise definition of what is entailed in it Traditionally, signal processing includes the materials thought in DSP courses but now signal processing has greater reach because of its influence on related disciplines such as controls, communications theory and also digital communication. Thus, signal processing can be defined as that area of applied mathematics that deals with operations on or analysis of signals, in either discrete or continuous time, to perform useful operations on those signals.
2-2
Fundamental of Signals
Digital signal processing is the process of extracting useful information from an incoming set of signal (sampled at regular interval, Ts)
When you speak, your voice is picked up by an analog sensor in the cell phones microphone
An analog-todigital converter chip converts your voice (analog) into digital signals, representing 1s and 0s
The Digital Signal Processor (DSP) compresses the digital signals and remove any noise.
In the receivers cell phone, a digital-to-analog converter chip changes the digital signal back to an analog voice signal
2-3
Fundamental of Signals
The Signal Processing Toolbox is a collection of tools built on the MATLAB numeric computing environment. The toolbox supports a wide range of signal processing operations, from waveform generation to filter design and implementation, parametric modeling, and spectral analysis. The toolbox provides two categories of tools.
2-4
Fundamental of Signals
Section Outline
Creating and importing signals Sampling and re-sampling Signal visualization Modeling noise Modulation
2-5
Fundamental of Signals
Discrete Signals
Time base: t = [0.0 0.1 0.2 0.3]; Signal data: x = [1.0 3.2 2.0 8.5];
2-6
Fundamental of Signals
Sampling Signals
Analog signal sources
Electromagnetic, audio, sonar, biomedical
Sampling
x(n) xa (nTs )
discrete signal analog signal sample time
2-7
Fundamental of Signals
Aliasing
Shannon Sampling Theorem:
fs 2 fM
fs 2 fM
fs 2 fM
Fundamental of Signals
Signal Visualization
View signal amplitude vs. time index Functions
plot, stem, stairs, strips
Listen to data
sound
2-9
Fundamental of Signals
>> sptool
2-10
Fundamental of Signals
Importing a Signal
Choose Import under the File menu
2-11
Fundamental of Signals
Since MATLAB is a programming language, an endless variety of different signals is possible. Here are some statements that generate several commonly used sequences, including the unit impulse, unit step, and unit ramp functions: >> t = (0:0.01:1); >> y = ones(101); >> y = t ; % step % ramp >> y = [1; zeros(100,1)]; % impulse
>> y = t.^2;
% exponential
2-12
Fundamental of Signals
Waveform generation
%two sinusoids, %one at 50 Hz %and one at %120Hz with %twice the amplitude %plot y versus time
%display only the first %50 points(zoom!)
>> plot(t,y)
>> plot(t(1:50),y(1:50))
2-13
Fundamental of Signals
Signal Browser
2-14
Fundamental of Signals
2-15
Fundamental of Signals
Signal Generation
Signals Create a time base vector
>> t = [0:0.1:2];
Nonperiodic functions
ones, zeros, step
Periodic functions
sin, cos, square, sawtooth
2-16
Fundamental of Signals
Non-periodic Signals
>> t = linspace(0,1,11)
Step
>> y = ones(11,1);
Impulse
>> y = [1;zeros(10,1)];
Ramp
>> y = 2*t;
2010 Trity Technologies Sdn Bhd. All Rights Reserved
2-17
Fundamental of Signals
Sine Waves
Parameters
General form
y A sin(2ft ) B A sin(2f (t )) B
2010 Trity Technologies Sdn Bhd. All Rights Reserved
2-18
Fundamental of Signals
Square Waves
>> sqw1 = square(2*pi*4*t);
2-19
Fundamental of Signals
Sawtooth Waves
>> saw1 = sawtooth(2*pi*3*t);
2-20
Fundamental of Signals
Complex Signals
x(t) = e j2ft = cos(2 ft) + j sin(2 ft) = cos(t) + j sin(t)
>> x = exp(2*pi*j*f*t);
Fs/2
0,Fs
z-plane: e j
2010 Trity Technologies Sdn Bhd. All Rights Reserved
Fundamental of Signals
input textread
Importing Data
xlsread
imread importdata
2010 Trity Technologies Sdn Bhd. All Rights Reserved
wavread uiimport
2-22
Fundamental of Signals
2-23
Fundamental of Signals
2-24
Fundamental of Signals
Pseudorandomness
0.95012928514718 This is the first number produced by the MATLAB uniform random number generator with its default settings. Is it random?
A random sequence is a vague notion ... in which each term is unpredictable to the uninitiated and whose digits pass a certain number of tests traditional with statisticians ...
- D.H. Lehmer
>> rand('state',s) Sets the state to s. >> rand('state',0) Resets the generator to its initial state. >> rand('state',sum(100*clock)) New state each time.
2010 Trity Technologies Sdn Bhd. All Rights Reserved
2-25
Fundamental of Signals
Resampling
Useful MATLAB functions
downsample, upsample, resample, interp, decimate
2-26
Fundamental of Signals
x = demod(y,fc,fs,'fm')
2-27