UNIVERSITY OF WARWICK

Similar documents
UNIVERSITY OF WARWICK

ELT COMMUNICATION THEORY

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Synthesis: From Frequency to Time-Domain

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

George Mason University Signals and Systems I Spring 2016

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

Electrical & Computer Engineering Technology

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Fourier Series and Gibbs Phenomenon

Sound synthesis with Pure Data

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

Problem Set 1 (Solutions are due Mon )

ECE 5650/4650 MATLAB Project 1

Lab 4 Fourier Series and the Gibbs Phenomenon

Laboratory 7: Active Filters

EGR 111 Audio Processing

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

Window Method. designates the window function. Commonly used window functions in FIR filters. are: 1. Rectangular Window:

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Figure 1: Block diagram of Digital signal processing

EE477 Digital Signal Processing Laboratory Exercise #13

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

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

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

Project 2 - Speech Detection with FIR Filters

Set-up. Equipment required: Your issued Laptop MATLAB ( if you don t already have it on your laptop)

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

Modulating Signal by Matlab. Amplitude modulation(am)

Presentation Outline. Advisors: Dr. In Soo Ahn Dr. Thomas L. Stewart. Team Members: Luke Vercimak Karl Weyeneth. Karl. Luke

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

Digital Signal Processing PW1 Signals, Correlation functions and Spectra

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

ELT COMMUNICATION THEORY

Signal Processing. Introduction

Signal Processing. Naureen Ghani. December 9, 2017

DFT: Discrete Fourier Transform & Linear Signal Processing

Introduction to Simulink Assignment Companion Document

ELEC3104: Digital Signal Processing Session 1, 2013

Attia, John Okyere. Plotting Commands. Electronics and Circuit Analysis using MATLAB. Ed. John Okyere Attia Boca Raton: CRC Press LLC, 1999

EBU5375 Signals and Systems: Filtering and sampling in Matlab. Dr Jesús Requena Carrión

Wireless Communication Systems Laboratory Lab#1: An introduction to basic digital baseband communication through MATLAB simulation Objective

Lab S-5: DLTI GUI and Nulling Filters. Please read through the information below prior to attending your lab.

ELT DIGITAL COMMUNICATIONS

Problems from the 3 rd edition

Digital Signal Processing

3.2 Measuring Frequency Response Of Low-Pass Filter :

The Formula for Sinusoidal Signals

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

ECE 5650/4650 Exam II November 20, 2018 Name:

ECE 201: Introduction to Signal Analysis

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

ELEC3104: Digital Signal Processing Session 1, 2013

Additive Synthesis OBJECTIVES BACKGROUND

SIGNALS AND SYSTEMS LABORATORY 3: Construction of Signals in MATLAB

Experiment Five: The Noisy Channel Model

MATLAB Assignment. The Fourier Series

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

SGN Bachelor s Laboratory Course in Signal Processing Audio frequency band division filter ( ) Name: Student number:

Discrete Fourier Transform (DFT)

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

Lab 8: Frequency Response and Filtering

SIGNALS AND SYSTEMS LABORATORY 13: Digital Communication

Digital Signal Processing ETI

EE 422G - Signals and Systems Laboratory

ADSP ADSP ADSP ADSP. Advanced Digital Signal Processing (18-792) Spring Fall Semester, Department of Electrical and Computer Engineering

DSP First Lab 03: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: k=1

Signals, sampling & filtering

Fourier Signal Analysis

ESE531 Spring University of Pennsylvania Department of Electrical and System Engineering Digital Signal Processing

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

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

GE U111 HTT&TL, Lab 1: The Speed of Sound in Air, Acoustic Distance Measurement & Basic Concepts in MATLAB

Experiment 2: Electronic Enhancement of S/N and Boxcar Filtering

Digital Signal Processing. VO Embedded Systems Engineering Armin Wasicek WS 2009/10

Principles of Communications ECS 332

Laboratory Assignment 5 Amplitude Modulation

Lab 1B LabVIEW Filter Signal

ECEGR Lab #8: Introduction to Simulink

Fall Music 320A Homework #2 Sinusoids, Complex Sinusoids 145 points Theory and Lab Problems Due Thursday 10/11/2018 before class

Digital Signal Processing ETI

Laboration Exercises in Digital Signal Processing

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

1.5 The voltage V is given as V=RI, where R and I are resistance matrix and I current vector. Evaluate V given that

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

ELT DIGITAL COMMUNICATIONS

Laboratory 5: Spread Spectrum Communications

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

School of Engineering and Information Technology ASSESSMENT COVER SHEET

Discrete Fourier Transform

Measuring Modulations

EE 311 February 13 and 15, 2019 Lecture 10

II. LAB. * Open the LabVIEW program (Start > All Programs > National Instruments > LabVIEW 2012 > LabVIEW 2012)

UNIVERSITY OF UTAH ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT

Computer Programming ECIV 2303 Chapter 5 Two-Dimensional Plots Instructor: Dr. Talal Skaik Islamic University of Gaza Faculty of Engineering

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

TIMA Lab. Research Reports

Transcription:

UNIVERSITY OF WARWICK School of Engineering ES905 MSc Signal Processing Module (2010) AM SIGNALS AND FILTERING EXERCISE Deadline: This is NOT for credit. It is best done before the first assignment. You will use the MATLAB package to design some FIR filters and use them to process some Amplitude Modulated (AM) Signals You may download copies of this document and useful files from the web: http://www2.warwick.ac.uk/fac/sci/eng/staff/rcs/msc/ The pages below are part of a self learning exercise. Copy the MATLAB files from the above website when instructed to do so. Think about the questions that have been posed and fill in the text boxes if you wish. Remember: This exercise is not for credit, just to aid your education. Do not hand your results in. 1

UNIVERSITY OF WARWICK School of Engineering ES905 Signal Processing, Assignment 1, Part A: AM Signals and Filtering Date: Introduction The exercise concerns the synthesis of some signals that are commonly found in communications systems. You will be adding noise to these signals. Filters will be designed to extract sinusoidal frequencies from the signals, and the noise content of the signals will be examined. You may plug headphones into the sockets at the front of some computers so that you can listen to the signals that you are observing as graphs on the screen. Matlab will be used extensively in this exercise. Before beginning, copy files: lab2_fir.m, lab2_synth.m, lab2_process.m, lab2_snr.m and noise_data.txt to your working directory. These can be found at: http://www2.warwick.ac.uk/fac/sci/eng/staff/rcs/msc/ass1/ Copy the files as instructed. FIR Filter Design File: lab2_fir.m Save to your local disk. Make sure it has.m extension and nothing else In this first experiment you are going to extract two sinusoids from a signal containing two added sinusoids. You will design FIR filters using the Remez exchange algorithm. In the lectures we studied a method to design FIR filters using frequency plane specification, and a Fourier series technique to obtain the filter s coefficients. Today you will use a CAD method which works by minimising the differences between the specified and actual filter responses. Open a Matlab window (Double click on the icon). Open lab2_fir.m by clicking File (top left corner), then open, and then select lab2_fir.m. An editor window will appear. To execute the code click debug, then run etc. Part 1 of the code concerns the synthesis of the signal to be filtered. Its specification is: First signal, x1, has frequency, = 100Hz, peak amplitude = 1V Second signal, x2, has frequency, x2 = 400Hz, peak amplitude = 1V Sampling frequency, fs = 2000Hz (ie folding frequency ff > 400 >,100Hz) Combined signal, x = x1 + x2. fs = 2000; t = 0:(1/fs):0.1; %Set up sampling intervals over a 0.1s period x1 = sin(2*pi*100*t); x2 = sin(2*pi*400*t); x = x1 + x2; subplot(3,1,1), plot(t,x) %Plot the signal against time title('the combined signal, x'); %Wait until <return> is pressed 2

The program will wait at the. Alternatively cut the required code and paste it to the Matlab window. Observe the signal. Does it appear to be correct? Can you see the summed sinusoids? Part 2 of the code concerns the specification of the 1 st filter. This will be low-pass with a nominal cut-off midway between 100Hz and 400Hz. However, for practicality, separate pass 0 to 225Hz), transition (225 to 275Hz), and stop bands (275 to folding frequency), are specified in vector: fhz0. fhz0 = [0 225 275 fs/2]; These are converted to be non-dimensional: f0 = fhz0/(fs/2); Next a vector containing the required gain of the filter at the specified frequencies appears. Eg Lowpass: [1 1 0 0], high-pass: [0 0 1 1], band-pass [0 0 1 1 0 0]. ml0 = [1 1 0 0]; Next the filter coefficients, brl are calculated. Notice the specification vectors f0 and ml0. The 60 is the order of the filter. [brl] = remez(60, f0, ml0); Observe how good the filter is by comparing the specification with its actual spectrum. fhz1 = linspace(0, fs/2, 50); om1 = 2*pi*fHz1; z = exp(sqrt(-1)*om1/fs); ml = abs(polyval(brl,z)); subplot(3,1,2), plot(fhz0, ml0, fhz1, ml) title('spectrum of low-pass filter'); ylabel(' G '); xlabel('frequency (Hz)'); Try designing some filters with different orders eg 6 and 20. Comment on the effect on the frequency response of changing the filter s order. Now return to filter order 60 and filter the signal to extract the low frequency sinusoid. y1 = filter(brl,1,x); subplot(3,1,3), plot(t,y1) title('the extracted low frequency signal, x'); 3

Comment on the lack of output for the 1 st 15ms. Now design and implement a high-pass filter to extract the 400Hz sinusoid from the signal. Plot three graphs:- Input signal against time; Modulus of filter gain against frequency; Output signal against time. Hints: (i) (ii) In the editor, copy the code for the low pass filter and modify it Display the 3 graphs, are they correct? Are the titles and labels correct? If so then give Matlab the command print and retrieve your hardcopy if you want one. Synthesise a Noisy AM Signal (File: lab2_synth.m) and (noise_data_10.txt) Read the file containing a random signal (noise) into array A. View and listen to a sample of the noise. %%% Read data from file produced by a C program into 1 x Flength array fid = fopen('noise_data_07.txt','r'); %open the file [A,Flength] = fscanf(fid,'%f',[1,inf]); %read the data into A A = A/300; A((Flength+1):(2*Flength)) = A; %adjust noise level and length plot(a(1:128)) title( Noise ); ylabel( Amplitude ); xlabel( Time (s) ); soundsc(a); %plot the 1 st 128 noise samples. Set a sampling frequency of 4kHz and create a 500Hz carrier wave. %%% Create carrier sinewave of length: 4.0secs, frequency: 500Hz fs = 4000; %sampling frequency 4000Hz t = 0:(1/fs):4.0; %create 'time' samples x1 = sin(2*pi*500*t); %create a 500Hz sinewave carrier subplot(3,1,1), plot(t(1:128),x1(1:128)) title('sample length of carrier wave'); soundsc(x1) Create a message signal. This will be an 80Hz sinusoid. Notice that its maximum amplitude has been limited to 0.3V. This will limit the modulation depth of the AM wave to ka = 0.3 as the carrier has a peak amplitude of 1V. AM wave, s( t) = Ac [1 + kam( t)]cos(2π f ct), where k a controls the modulation depth, f c is the carrier frequency, A c is the carrier peak amplitude, and m(t) is the message signal. %%% Create message signal sinewave of length: 4.0secs, frequency: 80Hz ka = 0.3; % modulation depth x2 = ka*sin(2*pi*80*t); subplot(3,1,2), plot(t(1:128),x2(1:128)) title('sample length of modulation wave'); soundsc(x2) 4

Create the AM signal, s %%% Amplitude modulate the carrier s = ((1 + x2).*x1); subplot(3,1,3), plot(t(1:128),s(1:128)) title('sample length of modulated carrier wave'); soundsc(s) Add noise to AM signal %%% Add noise to the AM signal n = A(1:(1 + (fs * 4.0))); % truncate noise sequence sn = s + n; % add noise to signal subplot(3,1,3), plot(t(1:128),sn(1:128)) title('sample length of noisy AM wave'); soundsc(sn) Three graphs should be visible on the PC screen:- Carrier wave against time; Message signal against time; Noisy AM signal against time. Obtain a printout of these on a single sheet of A4 if you wish. Process the Noisy AM Signal (File: lab2_process.m) In this section you will retrieve the message signal from the noisy AM signal that you synthesised in the previous section. This will be achieved by a three stage process :- (i) Band-pass filter the carrier wave, (ii) Rectify the modulated carrier, (iii) Low-pass filter the rectified carrier to obtain the message signal. (i) Band-pass filter the carrier wave. Design a filter. The filter is specified in the frequency domain. Transform the AM signal and view its spectrum. %%% Transform a sample of the AM signal to the frequency domain S=fft(sn(1:1024)); %use fast Fourier transform, sample length 1024 Sa=abs(S); % modulus of spectrum Sp=angle(S); %phase % Calibrate spectrum in Hz b = 1:1024; frs = (b-1)/1024*fs; % frequencies % plot graph clf % clear screen subplot(3,1,1), plot(frs,sa); title('spectrum of AM wave'); ylabel(' Sa '); Observe the carrier and sidebands. You must design a filter to extract both the carrier and the sidebands. The gain will be [0 0 1 1 0 0]. Try significant frequencies [0 350 440 560 650 fs/2] Hz. %%% Tune in the carrier. That is band pass filter the AM signal %design the filter fhz = [0 350 440 560 650 fs/2]; mbp = [0 0 1 1 0 0]; %specify significant frequencies %magnitude specification of band-pass 5

f0 = fhz/(fs/2); b_bp = remez(120, f0, mbp); %non-dimensional significant frequencies % obtain filter coefficients %check the pass and stop bands of the filter fhz1 = linspace(0, fs/2, 50); om1 = 2*pi*fHz1; z = exp(sqrt(-1)*om1/fs); bp = abs(polyval(b_bp,z)); subplot(3,1,2), plot(fhz1,bp) title('band-pass filter characteristic'); Now tune in the noisy AM signal % filter the noisy AM signal am = filter(b_bp,1,sn); AM = abs(fft(am(1:1024))); % Check the spectrum of the filtered AM signal subplot(3,1,3), plot(frs,am); title('spectrum of tuned AM wave'); ylabel(' Sa '); xlabel('frequency (Hz)'); Obtain a printout of these three frequency domain plots if you wish. Now you can detect the message signal. Firstly rectify the AM wave. %%% Retrieve the message signal (80 Hz sinusoid) % View a sample of the tuned (received) AM signal clf subplot(3,1,1), plot(t(1:400),am(1:400)) title('received AM signal'); soundsc(am); % Rectify the AM signal rec = am; % copy the am to rec for i = 1:(fs*4.0), if am(i) < 0; rec(i) = 0; % reset all negative samples to 0 end end subplot(3,1,2), plot(t(1:400),rec(1:400)) title('rectified AM signal'); soundsc(rec); The rectified signal must now be low-pass filtered. Specify and implement such a filter, and then use it to recover the message signal. 6

Specification of the low-pass filter. Frequency specification Vector (Hz): [ ] Non-dimensional frequency specification vector: [ ] Gain specification vector: [ ] Filter order: Comment on the suitability of this filter: Display the following three graphs on the PC screen:- Received AM signal against time; Rectified signal against time; Detected (low-pass filtered) signal against time. Obtain a printout of these if you wish. Comment on the appearance of the message signal. Investigate the Noisy Signals (File: lab2_snr.m) Signal to Noise Ratio (SNR). We can define the receiver input SNR as the ratio of the average power of the modulated input signal, P s to the average power of the input noise P n. Ps SNR = 10log. Pn Estimate the SNR of the noisy AM signal. In this case there are two ways to proceed. Firstly, P s and P n can be estimated before they are added (not generally the case). Secondly they can be estimated from measurements on the noisy AM signal. Estimation before P s and P n are added. Obtain statistics on s(t) and n(t). You need to calculate the average power of each signal, ie sum the squares of the individual samples and divide by N, the number of samples. eg: 1 N 2 P = ( n k ). n k = 1 [ ] N Basically you are calculating the mean square value, and noting that the mean value of each signal is zero, you can use the variance (var) function to calculate the average power of each signal. %%% Estimate SNR before addition of am signal and noise % Estimate noise power MEAN = mean(n) MAX = max(n) MIN = min(n) VARIANCE = var(n) 7

Pn = VARIANCE; subplot(3,1,1), plot(t(1:400),n(1:400)) title('sample of noise signal'); n_sq = n.* n; subplot(3,1,2), plot(t(1:400),n_sq(1:400)) title('sample of noise power'); ylabel('power (V**2)'); % Estimate signal power MEAN = mean(s) MAX = max(s) MIN = min(s) VARIANCE = var(s) Ps = VARIANCE; s_sq = s.* s; subplot(3,1,3), plot(t(1:400),s_sq(1:400)) title('sample of signal power'); ylabel('power (V**2)'); SNR = 10 * log10(ps/pn) %use log10 for base 10 Record the statistics and SNR of the separate signals Mean Maximum Minimum Variance (power) Signal s(t) Noise n(t) SNR db Estimate the SNR from the received AM wave. You will have to extract the noise and AM signals from the received signal. Use filters. You already have the band-pass filtered am wave. Try bandstop filtering with the inverse characteristic to obtain the noise. Then proceed as above. Record the statistics and SNR of the combined AM wave Mean Maximum Minimum Variance (power) Signal s(t) Noise n(t) SNR db Comment on the difference between the SNR when estimated by these two methods. RCS, 28/9/10 8