ELT COMMUNICATION THEORY

Similar documents
Electrical & Computer Engineering Technology

Problem Set 1 (Solutions are due Mon )

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

L A B 3 : G E N E R A T I N G S I N U S O I D S

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

1. In the command window, type "help conv" and press [enter]. Read the information displayed.

DFT: Discrete Fourier Transform & Linear Signal Processing

EE 422G - Signals and Systems Laboratory

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Spring Semester, Introduction to EECS 2

Signal Processing. Naureen Ghani. December 9, 2017

The Formula for Sinusoidal Signals

Experiment 8: Sampling

UNIVERSITY OF WARWICK

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

ECE 5650/4650 MATLAB Project 1

Introduction. A Simple Example. 3. fo = 4; %frequency of the sine wave. 4. Fs = 100; %sampling rate. 5. Ts = 1/Fs; %sampling time interval

Laboratory Assignment 4. Fourier Sound Synthesis

Fourier Transform. Prepared by :Eng. Abdo Z Salah

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Fall Semester, Introduction to EECS 2

Digital Signal Processing PW1 Signals, Correlation functions and Spectra

Project I: Phase Tracking and Baud Timing Correction Systems

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

Sound synthesis with Pure Data

Frequency Domain Representation of Signals

ECEGR Lab #8: Introduction to Simulink

UNIVERSITY OF WARWICK

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

Discrete Fourier Transform (DFT)

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Digital Signal Processing Fourier Analysis of Continuous-Time Signals with the Discrete Fourier Transform

ECE 2713 Homework 7 DUE: 05/1/2018, 11:59 PM

ECE 3793 Matlab Project 4

(i) Understanding the basic concepts of signal modeling, correlation, maximum likelihood estimation, least squares and iterative numerical methods

Fourier Series and Gibbs Phenomenon

Fourier Signal Analysis

Filters. Phani Chavali

Synthesis: From Frequency to Time-Domain

It is the speed and discrete nature of the FFT that allows us to analyze a signal's spectrum with MATLAB.

Lab 4 Fourier Series and the Gibbs Phenomenon

Additive Synthesis OBJECTIVES BACKGROUND

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

B.Tech III Year II Semester (R13) Regular & Supplementary Examinations May/June 2017 DIGITAL SIGNAL PROCESSING (Common to ECE and EIE)

THE CITADEL THE MILITARY COLLEGE OF SOUTH CAROLINA. Department of Electrical and Computer Engineering. ELEC 423 Digital Signal Processing

Experiments #6. Convolution and Linear Time Invariant Systems

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Universiti Malaysia Perlis EKT430: DIGITAL SIGNAL PROCESSING LAB ASSIGNMENT 1: DISCRETE TIME SIGNALS IN THE TIME DOMAIN

Laboration Exercises in Digital Signal Processing

Signal Processing. Introduction

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #8: Filter Design of FIR Filters

System Identification & Parameter Estimation

Signals and Systems EE235. Leo Lam

Digital Filter Design using MATLAB

Final Exam Solutions June 14, 2006

Digital Signal Processing

Basic Signals and Systems

Brief Introduction to Signals & Systems. Phani Chavali

Digital Signal Processing

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

Topic 2. Signal Processing Review. (Some slides are adapted from Bryan Pardo s course slides on Machine Perception of Music)

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

ELECTRONOTES APPLICATION NOTE NO Hanshaw Road Ithaca, NY August 3, 2017

EEM478-WEEK8 Finite Impulse Response (FIR) Filters

C2. Design of Digital Filters

Frequency Division Multiplexing Spring 2011 Lecture #14. Sinusoids and LTI Systems. Periodic Sequences. x[n] = x[n + N]

AC : FIR FILTERS FOR TECHNOLOGISTS, SCIENTISTS, AND OTHER NON-PH.D.S

Lecture Schedule: Week Date Lecture Title

Data Analysis in MATLAB Lab 1: The speed limit of the nervous system (comparative conduction velocity)

Lab course Analog Part of a State-of-the-Art Mobile Radio Receiver

EECS 452 Midterm Exam Winter 2012

Project 2 - Speech Detection with FIR Filters

CS3291: Digital Signal Processing

Simulation Scenario For Digital Conversion And Line Encoding Of Data Transmission

EECS 452 Practice Midterm Exam Solutions Fall 2014

ECE 201: Introduction to Signal Analysis. Dr. B.-P. Paris Dept. Electrical and Comp. Engineering George Mason University

Digital Signal Processing ETI

EE 451: Digital Signal Processing

EE 5410 Signal Processing

ECE 201: Introduction to Signal Analysis

EECE 301 Signals & Systems Prof. Mark Fowler

Midterm 1. Total. Name of Student on Your Left: Name of Student on Your Right: EE 20N: Structure and Interpretation of Signals and Systems

Signals and Filtering

Lecture 3, Multirate Signal Processing

Fourier Series. Discrete time DTFS. (Periodic signals) Continuous time. Same as one-period of discrete Fourier series

From Fourier Series to Analysis of Non-stationary Signals - VII

ECE 201: Introduction to Signal Analysis

EGR 111 Audio Processing

Signal Processing Summary

ECE 484 Digital Image Processing Lec 09 - Image Resampling

DCSP-10: DFT and PSD. Jianfeng Feng. Department of Computer Science Warwick Univ., UK

STANFORD UNIVERSITY. DEPARTMENT of ELECTRICAL ENGINEERING. EE 102B Spring 2013 Lab #05: Generating DTMF Signals

SAMPLING THEORY. Representing continuous signals with discrete numbers

AN2182 Application note

ADC Clock Jitter Model, Part 1 Deterministic Jitter

Transcription:

ELT 41307 COMMUNICATION THEORY Matlab Exercise #1 Sampling, Fourier transform, Spectral illustrations, and Linear filtering 1 SAMPLING The modeled signals and systems in this course are mostly analog (continuous time). However, the computer based simulation environment is always digital (discrete time), of course. Thus, in Matlab, we have certain constraints from the DSP (Digital Signal Processing) world, such as A continuous time signal x c (t) is represented by a vector, [x c (t 0 ) x c (t 1 )... x c (t N-1 )], whose length is N, i.e. the signal is truncated and sampled Time interval t N 1 t 0 and sampling interval T s =t i+1 t i depend on the signal Time interval is chosen large enough to obtain enough information Sampling frequency is typically chosen much higher than the Nyquist frequency, 2 f max o Sampling frequency F s =1/T s is chosen enough large so that the sampled signal looks like an analog signal in Matlab. The rule of thumb is at least 10 times the maximum frequency component EXAMPLE: RUN THE FOLLOWING STATEMENTS (IN THE COMMAND WINDOW OR IN A SCRIPT FILE) TO CREATE A 50 HZ SINUSOIDAL SIGNAL: >> Fs=500; % sampling frequency = 10*50Hz >> Ts=1/Fs; % sampling interval >> t=0:ts:0.1; % sampling time instants [s] >> x=sin(2*pi*50*t); % signal vector >> figure % Opens a new figure >> plot(t,x) % plot in time domain

2 FOURIER TRANSFORM (FT) X ( j ) j t x c ( t) e dt Continuous time FT, CTFT X ( e j ) jk x( k) e Discrete time FT, DTFT k N 1 j2kn/ N X ( n) x( k) e, n 0,1,..., N 1 k 0 Discrete FT, DFT Above and below x(k) is the sampled signal from the x c (t) x c (t) x(k)=x c (kt s ) X(f) (N-1)T s T s kt t s B B f ^ X(f) X(n) -F s -F s /2 B 0 F 0 B F s /2 F s 0 1 N/2 N-1 In Matlab, DFT can be calculated with the function fft. FFT calculation is not related to the actual sampling frequency F s, but it is given as 0 ((N-1)/N) 2π where π refers to half the sample rate. For plotting you have to generate the vector of frequency points. Frequency resolution F 0 depends on sampling frequency and the length of the signal vector. With real signals all the information is between 0 F s /2, but during this course we prefer to plot the spectrum in the two sided format ( F s /2 F s /2).

EXAMPLE: RUN THE FOLLOWING STATEMENTS (IN THE COMMAND WINDOW OR IN A SCRIPT FILE) TO PLOT THE DFT OF THE 50 HZ SINUSOIDAL SIGNAL: >>F_x=fft(x); >>Nx=length(x); >>Fo=1/(Ts*Nx); >>freq1=0:fo:(nx-1)*fo; >>figure >>plot(freq1,abs(f_x)/nx) >>freq2=-nx/2*fo:fo:(nx/2-1)*fo; >>figure >>plot(freq2,fftshift(abs(f_x)/nx)) % DFT of X, saved to Fx % frequency resolution. % One-sided frequency Axis % One-sided amplitude Spectrum % Two-sided frequency Axis % Two-sided amplitude Spectrum Scaling by Nx is required in Matlab in order to get correct amplitude values in the frequency domain. However, often it is more important to see the frequency content in general (and especially relative amplitudes between separate frequencies), in which case the scaling is not as essential. Fftshift is used to generate the two sided spectrum plot ( F s /2 F s /2). Time domain Frequency domain

3 SPECTRAL ILLUSTRATIONS At this point, if not yet done, you should create a new Matlab script file (.m) and write there the rest of the Matlab commands in this exercise (do the same also for the following Matlab exercises). Below you ll find a few tips, which might be useful when working with the scripts: It can be useful to start the script as clear; close all; clc, which automatically clears the old variables from the desktop (clear), closes all the open figures (close all), and clears the command window from the text (clc), when starting to run the script. Note that in the script you can comment any line or part of a line by adding the % sign (note that the shortcut to comment the whole line at once is ctrl+r). After the % sign, the following statements in the same line are ignored when the script is executed. You can execute/run a small part of the script by highlighting text, and then pressing F9. Now only the highlighted statements are executed. Remember also the Run button in the editor window to run the whole script at once (this will also save the script) You can create a code section by adding two % signs as %%. This might help in creating a more logical structure for the script (for example dividing the script into sections based on the exercise task numbers). You can run one section by selecting the section and pressing ctrl+enter, or from the editor window by Run section. 3.1 SIGNAL GENERATION Generate a f c = 800 MHz sinusoidal signal (this is actually a frequency used in LTE (4G) networks in Finland) with sampling frequency of Fs = 16 GHz (=16000MHz). Determine sampling interval Ts= Enter the length in samples N= Generate the signal x= (x(t) = sin(2πf c t)) Plot in time domain plot(t,x) Compute the length N and the frequency resolution Fo of the signal Compute DFT Fx=fft(x); Generate Frequency axis f= Plot the two sided (i.e., frequencies Fs/2 Fs/2) amplitude spectrum of x: plot(f, Add title and labels to the figure (help title, help xlabel, help ylabel) %EXAMPLE CODE is shown with this font and color % See the example of creating the signal, and plotting it in the time domain and % frequency domain in Sections 1 and 2: %... title('time domain Plot of x(t)') xlabel('t [s]') ylabel('amplitude') axis([0 20e-9-1.2 1.2]) %[x-axis_left_limit x-axis_right_limit y-axis_down_limit y-axis_up_limit] Notice that the time and frequency plotting commands can be mostly copy pasted for the corresponding plots in the following tasks!

3.2 MULTIPLICATION BETWEEN TWO SIGNALS Let s consider a new signal as s(t) = x(t) m(t), where m(t) is a sine wave with frequency of 750 MHz. Generate the new sinusoidal signal m = sin(..) Multiply the x and m signals s = (remember the element wise multiplication.*) Plot in time domain: plot(t,s) Plot the two sided amplitude spectrum of s(t): plot(f, 3.3 ADDING A NOISE SIGNAL Let s consider a model for a noisy signal as y(t) = 10 s(t) + n(t), where s(t) is the signal from the above multiplication task (3.2) and n(t) is white Gaussian noise with zero mean and variance of 1. Generate the noise signal n = randn(size(x)) (help randn) Add the noise signal to signal x to get the noisy signal y = 10*s + n; Plot in time domain plot(t,y) Plot the two sided amplitude spectrum of y so that the frequency axis is given in MHz o I.e. divide the frequency axis values by 1 MHz: plot(f/1e6,fftshift(abs(f_y))/n) 4 LINEAR FILTERING 4.1 LOW PASS BUTTERWORTH FILTER Create a low pass Butterworth filter (help butter) o Order of 10 o Cut off frequency of 200MHz f_cut = order= fr=f_cut/(fs/2); % Cut-off frequency normalized to 1. [b,a]=butter(order,fr); % Coefficients of the filter (help butter) Plot the frequency response of the filter (help freqz) freqz(b,a,n,fs) title('frequency response of the Butterworth filter') Filter the signal y(t) (from task 3.3) with the generated Butterworth filter (help filter) o y_filtered_butter = filter( ); Plot the filtered signal in time and frequency domain o Notice the filter delay Compare the original y(t) and the filtered y(t) with each other in time domain and frequency domain o What part of the signal is still visible after filtering in time/frequency domain?

4.2 BAND PASS FIR (FINITE IMPULSE RESPONSE) FILTER Create a band pass FIR filter (help firpm, see the figure below) o Order of 60 o Bass band: 1.3 GHz 1.8 GHz o Transition bands: 0.8 GHz 1.3 GHz and 1.8 GHz 2.3 GHz Illustration of arbitrary chosen f and a vectors used in the bass band filter design with firpm (b = firpm(n,f,a), where n is the filter order, and vectors f and a are illustrated below) order=60; % filter order f_filter = [0 0.8e9 1.3e9 1.8e9 2.3e9 Fs/2]/(Fs/2); a_filter = [0 0 1 1 0 0]; b = firpm(order,f_filter,a_filter); Plot the impulse response of the filter by using stem function (help stem) stem(-order/2:order/2,b) Plot the amplitude response of the filter by using fft F_b = fft(b,n); % We use same length with the frequency vector for the fft Filter the signal y(t) (from task 3.3) with the generated FIR filter (help filter) y_filtered_fir = filter(b,1,y); Plot the filtered signal in time and frequency domain o Again, notice the filter delay Compare y(t) and the filtered y(t) with each other in time domain and frequency domain o What part of the signal is still visible after filtering in time/frequency domain?