0% found this document useful (0 votes)
3 views

3com

The document covers three labs focusing on Amplitude Modulation (AM), Image Processing, and Digital Signal Processing (DSP). Key concepts include AM techniques, MATLAB functions for signal processing, basic image operations, and filter design methods. The document also highlights important operations such as Fourier Transforms, edge detection, and face detection in images.

Uploaded by

mahmoud ghaly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

3com

The document covers three labs focusing on Amplitude Modulation (AM), Image Processing, and Digital Signal Processing (DSP). Key concepts include AM techniques, MATLAB functions for signal processing, basic image operations, and filter design methods. The document also highlights important operations such as Fourier Transforms, edge detection, and face detection in images.

Uploaded by

mahmoud ghaly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Lab 3: Amplitude Modulation (AM)

1. Introduction
Amplitude Modulation (AM) is a technique used in communication
systems where the amplitude of a high-frequency carrier wave is
varied in accordance with the message signal. It is commonly used in
AM radio and broadcasting.

2. Key MATLAB Functions


a. Spectrum Function
function X = am_spectrum(x)
X = abs(fftshift(fft(x)));
end
b. Plot Function
function am_plot(idx, m, c, u, rng)
subplot(3,1,1); plot(idx, m); xlim(rng); title('Message');
subplot(3,1,2); plot(idx, c); xlim(rng); title('Carrier');
subplot(3,1,3); plot(idx, u); xlim(rng); title('Modulated');
end

3. AM Examples
Cosine Modulation
m = cos(2*pi*fm*t) - 0.25; % Message signal
c = cos(2*pi*fc*t); % Carrier
u = m .* c; % Modulated signal
Pulse Modulation
m = rectpuls(t, pw); % Rectangular pulse with width pw

4. Voice Signal AM (DSB-SC)


a. Modulation
[m, fs] = wavread('sm1_cln_32k.wav');
fc = 8000;
u = mymod(m, fc, fs);
b. Demodulation
dm = mydemod(u, fc, fs);
soundsc(dm, fs);
c. Carrier Frequency Mismatch
[dm8000_5, e8000_5] = am_test(8000, 5);

5. Key Takeaways
• Sidebands appear at fc ± fm.
• Accurate demodulation requires matching carrier frequency.
• High carrier frequency avoids overlap in spectrum.

Lab 4: Image Processing


1. Basic Operations
• imread(): Reads an image file.
• imshow(): Displays an image.
• imagesc(): Displays image with scaled colors.
• imwrite(): Saves image to file.
2. Conversion Functions
• rgb2gray(): Convert color to grayscale.
• im2bw(): Convert to binary image.
• imhist(): Show histogram.
• imresize(), imrotate(), imtranslate(): Resize, rotate, move image.

3. Frequency Domain
• fft2(): 2D Fast Fourier Transform.
• fftshift(): Shift zero-frequency to center.
• dct2(): 2D Discrete Cosine Transform.

4. Image Enhancement
• imadjust(): Adjust intensity values.
• histeq(): Histogram equalization.
• imnoise(): Add noise to image.
• imfilter(): Apply filters.
• medfilt2(): Median filtering.
• fspecial('gaussian', size): Create Gaussian filter.
5. Edge Detection & Morphology
• edge(): Detect edges (e.g., 'canny').
• imsharpen(): Sharpen image.
• im2bw(): Threshold image.
• imerode(), imdilate(): Morphological operations.
• imopen(), imclose(): Combine erosion and dilation.

6. Face Detection Example


FaceDetector = vision.CascadeObjectDetector();
BBox = step(FaceDetector, img);
imshow(insertObjectAnnotation(img, 'rectangle', BBox, 'Face'));

Lab 5: Digital Signal Processing (DSP)


1. Continuous Signals
Special Signals
• Delta Function: dirac(t)
• Unit Step: heaviside(t)
Periodic Signals
• Sine: sin(2*pi*fm*t)
• Square: square(2*pi*fm*t)
• Sawtooth: sawtooth(2*pi*fm*t)
• Pulse Train: pulstran(t, D, @rectpuls, w)
Aperiodic Signals
• Triangular Pulse: tripuls(t, width)
• Rectangular Pulse: rectpuls(t, width)

2. Fourier Transform (FT)


• Compute FT: fourier(f, t, w)
• Inverse FT: ifourier(F, w, t)
• Properties: e.g., fourier(diff(f(t), t), t, w)

3. Discrete Signals
Sampling
• Sampled Signals: Use stem.
• Resampling: downsample, resample.
Discrete Sequences
• X = [2, 3, -1, -2, 7]
• stem(X)

4. Discrete Fourier Transform (DFT)


• DFT: fft(x)
• Inverse DFT: ifft(X)
5. Z-Transform
• Z-Transform: ztrans(x, n, z)
• Inverse: iztrans(X, z, n)
• Partial Fractions: residuez(num, den)
• Pole-Zero Plot: zplane(num, den)
• Frequency Response: freqz(num, den, w)

6. Analog Filters
Types:
• Low Pass (LPF)
• High Pass (HPF)
• Band Pass (BPF)
• Band Stop (BSF)
Design:
• Butterworth: buttap
• Chebyshev: cheb1ap, cheb2ap
• Elliptic: ellip
Frequency Response:
• bode, freqs
Transformations:
• lp2lp, lp2hp, lp2bp, lp2bs
7. Digital Filters
Design Methods
• From analog: bilinear
• Direct: butter, cheby1, cheby2, ellip
Application
• Filter a signal: y = filter(bz, az, g)
Example
gt = 3 + 1.5*sin(n*T) - cos(2*n*T) + sin(8*n*T);
[az, bz] = butter(6, wn);
y = filter(az, bz, gt);
Cadence Virtuoso Shortcuts (Custom IC Design)

You might also like