Delete DP Manual
Delete DP Manual
#################################################################################
# Python Script for designing low pass filter and plotting the frequency response
---------------------------------------------------------------------------------
import numpy as np
nyq = 0.5 * fs
return b, a
y = lfilter(b, a, data)
return y
# Filter requirements.
order = 6
w, h = freqz(b, a, worN=8000)
plt.subplot(2, 1, 1)
plt.axvline(cutoff, color='k')
plt.xlim(0, 0.5*fs)
plt.xlabel('Frequency [Hz]')
Design Practice Lab Manual ( AY 2021-22 )
plt.grid()
T = 5.0 # seconds
t = np.linspace(0, T, n, endpoint=False)
+ 0.5*np.sin(12.0*2*np.pi*t)
# Filter the data, and plot both the original and filtered signals.
plt.subplot(2, 1, 2)
plt.xlabel('Time [sec]')
plt.grid()
plt.legend()
plt.subplots_adjust(hspace=0.35)
plt.show()
Design Practice Lab Manual ( AY 2021-22 )
##################################################################################
# Python Script for designing bandpass filter and plotting the frequency response
----------------------------------------------------------------------------------
nyq = 0.5 * fs
return b, a
y = lfilter(b, a, data)
return y
if __name__ == "__main__":
import numpy as np
fs = 5000.0
lowcut = 500.0
highcut = 1250.0
plt.figure(1)
plt.clf()
w, h = freqz(b, a, worN=2000)
Design Practice Lab Manual ( AY 2021-22 )
'--', label='sqrt(0.5)')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Gain')
plt.grid(True)
plt.legend(loc='best')
T = 0.05
nsamples = T * fs
a = 0.02
f0 = 600.0
plt.figure(2)
plt.clf()
plt.xlabel('time (seconds)')
plt.grid(True)
plt.axis
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )
#################################################################################
---------------------------------------------------------------------------------
import numpy as np
t = np.linspace(0, 1, 1000)
carrier = A_c*np.cos(2*np.pi*f_c*t)
modulator = A_m*np.cos(2*np.pi*f_m*t)
product = A_c*(1+modulation_index*np.cos(2*np.pi*f_m*t))*np.cos(2*np.pi*f_c*t)
plt.subplot(3,1,1)
plt.title('Amplitude Modulation')
plt.plot(modulator,'g')
plt.ylabel('Amplitude')
plt.xlabel('Message signal')
plt.subplot(3,1,2)
plt.plot(carrier, 'r')
plt.ylabel('Amplitude')
plt.xlabel('Carrier signal')
plt.subplot(3,1,3)
plt.plot(product, color="purple")
Design Practice Lab Manual ( AY 2021-22 )
plt.ylabel('Amplitude')
plt.xlabel('AM signal')
plt.subplots_adjust(hspace=1)
plt.rc('font', size=15)
fig = plt.gcf()
fig.set_size_inches(16, 9)
##################################################################################
----------------------------------------------------------------------------------
Design Practice Lab Manual ( AY 2021-22 )
import numpy as np
modulator_frequency = 4.0
carrier_frequency = 40.0
modulation_index = 1.0
product = np.zeros_like(modulator)
for i, t in enumerate(time):
plt.subplot(3, 1, 1)
plt.title('Frequency Modulation')
plt.plot(modulator)
plt.ylabel('Amplitude')
plt.xlabel('Modulator signal')
plt.subplot(3, 1, 2)
plt.plot(carrier)
plt.ylabel('Amplitude')
plt.xlabel('Carrier signal')
plt.subplot(3, 1, 3)
plt.plot(product)
plt.ylabel('Amplitude')
plt.xlabel('Output signal')
plt.show()
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )
##################################################################################
Take the input from the user and display the following output
----------------------------------------------------------------------------------
import math
# Input data
##############################################################################
##############################################################################
clear
% Transmitter
for ii = 1:length(Eb_N0_dB)
y = h.*s + 10^(-Eb_N0_dB(ii)/20)*n;
% equalization
yHat = y./h;
ipHat = real(yHat)>0;
end
EbN0Lin = 10.^(Eb_N0_dB/10);
theoryBer = 0.5.*(1-sqrt(EbN0Lin./(EbN0Lin+1)));
% plot
close all
figure
semilogy(Eb_N0_dB,theoryBerAWGN,'cd-','LineWidth',2);
hold on
semilogy(Eb_N0_dB,theoryBer,'bp-','LineWidth',2);
semilogy(Eb_N0_dB,simBer,'mx-','LineWidth',2);
grid on
legend('AWGN-Theory','Rayleigh-Theory', 'Rayleigh-Simulation');
xlabel('Eb/No, dB');
######################################################################
% Script for computing the BER for BPSK modulation in 3 tap ISI
#######################################################################
clear
K = 4;
for ii = 1:length(Eb_N0_dB)
% Transmitter
nTap = 3;
chanOut = conv(s,ht);
% Noise addition
for kk = 1:K
L = length(ht);
Design Practice Lab Manual ( AY 2021-22 )
d = zeros(1,2*kk+1);
d(kk+1) = 1;
c = [inv(hM)*d.'].';
% mathched filter
yFilt = conv(y,c);
yFilt = yFilt(kk+2:end);
ipHat = real(ySamp)>0;
end
end
% plot
close all
figure
semilogy(Eb_N0_dB,simBer(1,:),'bs-'),'Linewidth',2;
hold on
semilogy(Eb_N0_dB,simBer(2,:),'gd-'),'Linewidth',2;
semilogy(Eb_N0_dB,simBer(3,:),'ks-'),'Linewidth',2;
Design Practice Lab Manual ( AY 2021-22 )
semilogy(Eb_N0_dB,simBer(4,:),'mx-'),'Linewidth',2;
grid on
legend('sim-3tap', 'sim-5tap','sim-7tap','sim-9tap');
xlabel('Eb/No, dB');
1- Starting HFSS –
Select Programs, and select An soft, HFSS program group. Click HFSS –
Or double click on the HFSS icon on the Windows Desktop.
From the Project Manager window. Right-Click the project file and select Save As from the
sub menu.
Due to the nature of this design, we will use Driven Modal as the solution type. From the
HFSS menu select Solution Type and Driven Modal
The units are chosen as mm by choosing the heading 3D modeler and Units from the menu
Design Practice Lab Manual ( AY 2021-22 )
HFSS relies on variables for any parameterization / optimization within the project.
Variables also hold many other benefits which will make them necessary for all projects.
• Fixed Ratios (length, width, height) are easily maintained using variables.
• Optimetrics use variables to optimize the design according to user-defined criteria.
• All dimensions can be quickly changed in one window as opposed to altering each object
individually.
Click the HFSS heading and select Design Properties at the bottom of the menu.
Design Practice Lab Manual ( AY 2021-22 )
This will open the variable table. Add all variables shown below by selecting Add. Be sure
to include units as needed.
We will start to by creating the dipole element using the Draw Cylinder button from the
toolbar.
By default, the proprieties dialog will appear after you have finished drawing an object.
The position and size of objects can be modified from the dialog.
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )
Follow the format above for structure size. Give the name Monopole to this object. Assign the
material PEC and click OK. PEC (Perfect Electric Conductor) will create ideal conditions for
the element.
Create the circle with the dimensions shown in below figure and name it as infinite ground
and assign the material PEC and click OK.
Design Practice Lab Manual ( AY 2021-22 )
In the section you will create a Lumped Gap Source. This will provide an excitation to the
dipole structure. Begin by selecting the YZ plane from the toolbar. Using the 3D toolbar, click
Draw Rectangle and place two arbitrary points within the model area.
With the source geometry in place, the user must provide an excitation. A lumped port will
be used for the monopole model. This excitation is commonly used when the far field region
is of primary interest. In the project explorer, right-click Excitation -> Assign -> Lumped
Port
Design Practice Lab Manual ( AY 2021-22 )
Name the port source and leave the default values for impedance.
Using the mouse, position the cursor to the bottom-centre of the port. Ansoft's snap feature
should place the pointer when the user approaches the centre of any object. Left-click to define
the origin of the E-field vector. Move the cursor to the top-centre of the port. Left- click to
terminate the E-field vector. Click finish to complete the port excitation.
Note: In case you find some difficulties for drawing the lumped port, you can redraw the
rectangular plane, affect the lumped port, then resize the rectangular plane.
Design Practice Lab Manual ( AY 2021-22 )
6. Radiation Boundary:
In this section, a radiation boundary is created so that far field information may be extracted
from the structure. To obtain the best result, a cylindrical air boundary isdefined with
a distance of λ/4. From the toolbar, select Draw Cylinder.
With all faces selected, right-click the Boundary icon in the object explorer and select
Boundary -> Assign -> Radiation
7. Solutio Setup:
In this section a solution must be defined to display the desired data. We are primarily
interested in the frequency response of the structure. We will also explore HFSS's ability to
calculate general antenna parameters such as directivity, radiation resistance, radiation
efficiency, etc...,
From the project explorer, select Analysis -> Add Solution Setup.
Design Practice Lab Manual ( AY 2021-22 )
To view the frequency response of the structure, a frequency sweep must be defined. From
the project explorer select Setup1 -> Add Sweep
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )
8. Structure Analysis:
At this point, the user should be ready to analyse the structure. Before running the analysis,
always verify the project by selecting from the 3D toolbar. If everything is correct the
user should see:
9. Create Reports:
After completion of the analysis, we will create a report to display both the resonant frequency
and the radiation pattern. Click on the heading HFSS and select Results -> CreateReports
Design Practice Lab Manual ( AY 2021-22 )
Select the following highlighted parameters and click Add Trace to load the options into the
Trace window.
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )
HFSS can compute antenna parameters automatically. To produce the calculations, the user
must define an infinite sphere for far field calculations. Right-click the Radiation icon in the
project manager window and select Insert Far Field Setup -> Infinite Sphere
Next, the far field will be plotted. Create Reports as previously shown. Modify the following:
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )
Design Practice Lab Manual ( AY 2021-22 )