{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 5: Sampling" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.12: Find_the_frequency.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "omega=%pi/4;\n", "T=10^(-3)\n", "w=omega/T;\n", "disp(w)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.14: Sampling_period.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "[N,kerA]=linsolve(5*%pi/9,-2*%pi);\n", "N1=floor(N);\n", "disp(N1);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.1: Minimum_Sampling_Frequency.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.1\n", "clc;\n", "fmax=30;\n", "fmin=20;\n", "BW=fmax-fmin;\n", "disp(BW,'Bandwidth (kHz)');\n", "mFs=2*BW;\n", "disp(mFs,'Minimum Sampling Frequency (kHz)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.2_a: Minimum_Sampling_Interval.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.2a\n", "clc;\n", "syms T;\n", "disp('x(t)=1+cos(20%pi*t)');\n", "w=20*%pi;\n", "f=w/(2*%pi);\n", "T=1/(2*f);\n", "disp(T,'minimun sampling interval');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.2_b: Minimum_Sampling_Interval.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.2b\n", "clc;\n", "disp('x(t)=(1/2%pi*t)[sin(31%pi*t)-sin(29%pi*t)]');\n", "w1=31*%pi;\n", "f1=w1/(2*%pi);\n", "w2=29*%pi;\n", "f2=w2/(2*%pi);\n", "if f1