Sie sind auf Seite 1von 12

questions:

1-explain aliasing effect 2-folding and shifting of signals(program) 3-linear convolution using c program... 4- compare circular convolution with linear convolution 5-Eliminate high frequency component from a continuous signal(refer to chapter one)...... Anti- aliasing low pass filter 6-overlap save method(program) 7-convert an analog filter to a digital filter using impulse invariant method and Bilinear transformation method... 8-design (a) a Butterworth and (b)a chebyshev analog high pass filter that will pass all signals of radian frequencies greater than 200rad/sec with no more than 2 dB attenuation and have a stopband attenuation of greater than 20 dB for all (omega) less than 100 rad/sec. 9-X(n)={1 2 -3 0 1 -1 4 2}. evaluate x(k) without using dft. find x0, x4, x(k) [k=0 to 7]

answers:

1. In signal processing and related disciplines, aliasing refers to an effect that causes different signals to become indistinguishable (or aliases of one another) when sampled. It also refers to the distortion or artifact that results when the signal reconstructed from samples is different from the original continuous signal. if a piece of music is sampled at 32000 samples per second (sps), any frequency components above 16000 Hz (the Nyquist frequency) will cause aliasing when the music is reproduced by a digital to analog converter (DAC). To prevent that, it is customary to remove components above the Nyquist frequency (with an antialiasing filter) prior to sampling. But any realistic filter or DAC will also affect (attenuate) the components just below the Nyquist frequency. Therefore, it is also customary to choose a higher Nyquist frequency by sampling faster. Actual signals have finite duration and their frequency content, as defined by the Fourier transform, has no upper bound. Some amount of aliasing always occurs when such functions are sampled. Functions whose frequency content is bounded (bandlimited) have infinite duration. If sampled at a high enough rate, determined by the bandwidth, the original function can in theory be perfectly reconstructed from the infinite set of samples. Sometimes aliasing is used intentionally on signals with no low-frequency content, called bandpass signals. Undersampling, which creates low-frequency aliases, can produce the same result, with less effort, as frequency-shifting the signal to lower frequencies before sampling at the lower rate. Some digital channelizers[3] exploit aliasing in this way for computational efficiency

3. linear convolution using C program:

/* prg to implement linear convolution */ #include<stdio.h> #include<math.h> int y[20]; main() { int m=6; /*Length of i/p samples sequence*/ int n=6; /*Length of impulse response Coefficients */ int i=0,j; int x[15]={1,2,3,4,5,6,0,0,0,0,0,0}; /*Input Signal Samples*/ int h[15]={1,2,3,4,5,6,0,0,0,0,0,0}; /*Impulse Response Co-efficients*/ for(i=0;i<m+n-1;i++) { y[i]=0; for(j=0;j<=i;j++) y[i]+=x[j]*h[i-j]; } for(i=0;i<m+n-1;i++) printf("%d\n",y[i]); }

4. Linear convolution takes two functions of an independent variable, which I will call time, and convolves them using the convolution sum formula you might find in a linear sytems or digital signal processing book. Basically it is a correlation of one function with the time-reversed version of the other function. I think of it as flip, multiply, and sum while shifting one function with respect to the other. This holds in continuous time, where the convolution sum is an integral, or in discrete time using vectors, where the sum is truly a sum. It also holds for functions defined from -Inf to Inf or for functions with a finite length in time. Circular convolution is only defined for finite length functions (usually, maybe always, equal in length), continuous or discrete in time. In circular convolution, it is as if the finite length functions repeat in time, periodically. Because the input functions are now periodic, the convolved output is also periodic and so the convolved output is fully specified by one of its periods. Quick example: h(n) : transfer function x(n) : signal linear convolution: y(n)=h(n-k)*x(k) ; from 0 to N-1 circular convolution y(n)=h[(n-k) mod N]*x(k) ; from 0 to N-1

Matlab example: >> a=1:4 a= 1234 >> b=5:8 b= 5678 Linear convolution >> conv(a,b) ans = 5 16 34 60 61 52 32 circullar convolution >> real(ifft(fft(a).*fft(b))) ans = 66 68 66 60

7. Impulse invariance method for analog-to-digital filter conversion Syntax [bz,az] = impinvar(b,a,fs) [bz,az] = impinvar(b,a,fs,tol) Description [bz,az] = impinvar(b,a,fs) creates a digital filter with numerator and denominator coefficients bz and az, respectively, whose impulse response is equal to the impulse response of the analog filter with coefficients b and a, scaled by 1/fs. If you leave out the argument fs, or specify fs as the empty vector [], it takes the default value of 1 Hz. [bz,az] = impinvar(b,a,fs,tol) uses the tolerance specified by tol to determine whether poles are repeated. A larger tolerance increases the likelihood that impinvar interprets closely located poles as multiplicities (repeated ones). The default is 0.001, or 0.1% of a pole's magnitude. Note that the accuracy of the pole values is still limited to the accuracy obtainable by the roots function. Examples Example 1 Convert an analog lowpass filter to a digital filter using impinvar with a sampling frequency of 10 Hz: [b,a] = butter(4,0.3,'s'); [bz,az] = impinvar(b,a,10); Example 2 Illustrate the relationship between analog and digital impulse responses The steps used in this example are: 1. Create an analog Butterworth filter 2. Use impinvar with a sampling frequency Fs of 10 Hz to scale the coefficients by 1/Fs. This compensates for the gain that will be introduced in Step 4 below.

3. Use Control System Toolbox impulse function to plot the continuous-time unit impulse response of an LTI system. 4. Plot the digital impulse response, multiplying the numerator by a constant (Fs) to compensate for the 1/Fs gain introduced in the impulse response of the derived digital filter. 5. [b,a] = butter(4,0.3,'s'); 6. [bz,az] = impinvar(b,a,10); 7. sys = tf(b,a); 8. impulse(sys); 9. hold on; 10. impz(10*bz,az,[],10); Zooming the resulting plot shows that the analog and digital impulse responses are the same.

Algorithms impinvar performs the impulse-invariant method of analog-to-digital transfer function conversion discussed in reference: 1. It finds the partial fraction expansion of the system represented by b and a. 2. It replaces the poles p by the poles exp(p/fs). 3. It finds the transfer function coefficients of the system from the residues from step 1 and the poles from step 2.

Bilinear transformation method for analog-to-digital filter conversion Syntax [zd,pd,kd]=bilinear(z,p,k,fs) [zd,pd,kd]=bilinear(z,p,k,fs,fp) [numd,dend]=bilinear(num,den,fs) [numd,dend]=bilinear(num,den,fs,fp) [Ad,Bd,Cd,Dd]=bilinear(A,B,C,D,fs) [Ad,Bd,Cd,Dd]=bilinear(A,B,C,D,fs,fp) Description The bilinear transformation is a mathematical mapping of variables. In digital filtering, it is a standard method of mapping the s or analog plane into the z or digital plane. It transforms analog filters, designed using classical filter design techniques, into their discrete equivalents. The bilinear transformation maps the s-plane into the z-plane by

This transformation maps the j axis (from = to +) repeatedly around the unit circle (ejw, from = to ) by

bilinear can accept an optional parameter Fp that specifies prewarping. fp, in hertz, indicates a "match" frequency, that is, a frequency for which the frequency responses before and after mapping match exactly. In prewarped mode, the bilinear transformation maps the s-plane into the z-plane with

With the prewarping option, bilinear maps the j axis (from = to +) repeatedly around the unit circle (ejw, from = to ) by

In prewarped mode, bilinear matches the frequency 2fp (in radians per second) in the s-plane to the normalized frequency 2fp/fs (in radians per second) in the z-plane. The bilinear function works with three different linear system representations: zero-pole-gain, transfer function, and state-space form. Zero-Pole-Gain [zd,pd,kd] = bilinear(z,p,k,fs) and [zd,pd,kd] = bilinear(z,p,k,fs,fp) convert the s-domain transfer function specified by z, p, and k to a discrete equivalent. Inputs z and p are column vectors containing the zeros and poles, k is a scalar gain, and fs is the sampling frequency in hertz. bilinear returns the discrete equivalent in column vectors zd and pd and scalar kd. The optional match frequency, fp is in hertz and is used for prewarping. Transfer Function [numd,dend] = bilinear(num,den,fs) and [numd,dend] = bilinear(num,den,fs,fp) convert an s-domain transfer function given by num and den to a discrete equivalent. Row vectors num and den specify the coefficients of the numerator and denominator, respectively, in descending powers of s. Let B(s) be the numerator polynomial and A(s) be the denominator polynomial. The transfer function is:

fs is the sampling frequency in hertz. bilinear returns the discrete equivalent in row vectors numd and dend in descending powers of z (ascending powers of z 1 ). fp is the optional match frequency, in hertz, for prewarping. State-Space

[Ad,Bd,Cd,Dd] = bilinear(A,B,C,D,fs) and [Ad,Bd,Cd,Dd] = bilinear(A,B,C,D,fs,fp) convert the continuoustime state-space system in matrices A, B, C, D

to the discrete-time system:

fs is the sampling frequency in hertz. bilinear returns the discrete equivalent in matrices Ad, Bd, Cd, Dd. The optional match frequency, fp is in hertz and is used for prewarping. Algorithms bilinear uses one of two algorithms depending on the format of the input linear system you supply. One algorithm works on the zero-pole-gain format and the other on the state-space format. For transfer function representations, bilinear converts to state-space form, performs the transformation, and converts the resulting state-space system back to transfer function form. Zero-Pole-Gain Algorithm For a system in zero-pole-gain form, bilinear performs four steps: 1. If fp is present, it prewarps: 2. fp = 2*pi*fp; 3. fs = fp/tan(fp/fs/2) otherwise, fs = 2*fs. 4. It strips any zeros at using 5. z = z(finite(z)); 6. It transforms the zeros, poles, and gain using 7. pd = (1+p/fs)./(1-p/fs); % Do bilinear transformation 8. zd = (1+z/fs)./(1-z/fs);

9. kd = real(k*prod(fs-z)./prod(fs-p)); 10. It adds extra zeros at -1 so the resulting system has equivalent numerator and denominator order. State-Space Algorithm For a system in state-space form, bilinear performs two steps: 1. If fp is present, let

If fp is not present, let =fs. 2. Compute Ad, Bd, Cd, and Dd in terms of A, B, C, and D using

Diagnostics bilinear requires that the numerator order be no greater than the denominator order. If this is not the case, bilinear displays Numerator cannot be higher order than denominator. For bilinear to distinguish between the zero-pole-gain and transfer function linear system formats, the first two input parameters must be vectors with the same orientation in these cases. If this is not the case, bilinear displays First two arguments must have the same orientation.

8chebychev ap=2; as=20; fp=200; fs=100; F=1000; %taking sampling frequency 1khz omp=2*fp/F; oms=2*fs/F; [n,wn]=cheb1ord(omp,oms,ap,as); [b,a]=cheby1(n,ap,wn,'high'); w=0:0.1:pi; [h,om]=freqz(b,a,w); subplot(2,1,1); plot(om/pi,20*log(abs(h))); subplot(2,1,2); plot(om/pi,angle(h)); Butterworth ap=2; as=20; fp=200; fs=100; F=1000; %taking sampling frequency 1khz omp=2*fp/F; oms=2*fs/F; [n,wn]=buttord(omp,oms,ap,as); [b,a]=butter(n,wn,'high'); w=0:0.1:pi; [h,om]=freqz(b,a,w); subplot(2,1,1); plot(om/pi,20*log(abs(h))); subplot(2,1,2); plot(om/pi,angle(h));

Das könnte Ihnen auch gefallen