"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.1, page no 50"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#find Nquist Rate\n",
"\n",
"#Variable declaration\n",
"#given \n",
"pi=3.14\n",
"w1=50*pi\n",
"w2=300*pi\n",
"w3=100*pi\n",
"#w=2*%pi*f\n",
"\n",
"#Calculation\n",
"f1=w1/(2*pi)\n",
"f2=w2/(2*pi)\n",
"f3=w3/(2*pi)\n",
"fm=f2 #fm = maximum frquency is present at the signal\n",
"\n",
"#Result\n",
"print('maximum frquency of the signal is = %.2f Hz' %f2)\n",
"fs=2*fm #Nyquist rate\n",
"print('Nquist Rate of Signal is = %.2f Hz' %fs)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"maximum frquency of the signal is = 150.00 Hz\n",
"Nquist Rate of Signal is = 300.00 Hz\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2 , page no 50"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#Find Nquist Rate and Nquist time interval\n",
"\n",
"#Variable declaration\n",
"#given\n",
"w1=5000*math.pi\n",
"w2=3000*math.pi;\n",
"f1=w1/(2*math.pi);\n",
"f2=w2/(2*math.pi);\n",
"\n",
"#Calculation\n",
"fm=f1 #fm = maximum frquency is present at the signal\n",
"fs=2*fm #Nyquist rate\n",
"Ts=1.0/(2.0*fm) #frequncy =1/time\n",
"Ts=Ts*(10**3)\n",
"\n",
"#Result\n",
"print('maximum frquency of the signal is = %.f Hz' %f1)\n",
"print('Nquist Rate of the given Signal is = %.f Hz' %fs)\n",
"print('Nquist Interval of the given signal is = %.1f m Sec' %Ts)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"maximum frquency of the signal is = 2500 Hz\n",
"Nquist Rate of the given Signal is = 5000 Hz\n",
"Nquist Interval of the given signal is = 0.2 m Sec\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.3, page no 51"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Find Nquist Rate \n",
"\n",
"#Variable declaration\n",
"#given\n",
"f=100.0 # Frequency component of continuous-time signal\n",
"\n",
"#Calculation\n",
"fs=2*f #Nyquist rate\n",
"\n",
"#Result\n",
"print('i) To avoid aliasing Nquist Rate is = %.f Hz' %fs)\n",
"print('ii) It is theoretical example ')\n",
"print('iii) It is theoretical example ')\n",
"print('iv) It is theoretical example ')\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"i) To avoid aliasing Nquist Rate is = 200 Hz\n",
"ii) It is theoretical example \n",
"iii) It is theoretical example \n",
"iv) It is theoretical example \n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.4, page no 52 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#Find Nquist Rate of Continous signal\n",
"\n",
"#Variable declaration\n",
"#given\n",
"w1=50*math.pi\n",
"w2=300*math.pi\n",
"w3=100*math.pi\n",
"\n",
"#Calculation\n",
"f1=w1/(2*math.pi)\n",
"f2=w2/(2*math.pi)\n",
"f3=w3/(2*math.pi)\n",
"fmax=f2 #fmax = Highest frquency component of the message signal\n",
"fs=2*fmax #Nyquist rate\n",
"\n",
"#Result\n",
"print('Highest frquency component of the message signal will be fmax = %.f Hz' %fmax)\n",
"print('Nquist Rate of the given Signal is = %.f Hz' %fs)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Highest frquency component of the message signal will be fmax = 150 Hz\n",
"Nquist Rate of the given Signal is = 300 Hz\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"