Exercise 2.1: Basic digital signals (a) Write a MATLAB program to generate and display (using the...

50.1K

Verified Solution

Question

Electrical Engineering

Exercise 2.1: Basic digital signals (a) Write a MATLAB programto generate and display (using the stem function) the signalsdefined in Table 1. The MATLAB code of the first signal (dirac) isgiven in the report template as an example. (b) Write a MATLABfunction [x, t] = sin_NU(f0, fs, T) to generate a sine signal. Theoutput parameters x and t are the signal and time vectors,respectively. The input parameters are f0 (signal frequency in Hz),fs (sampling frequency in Hz), T (signal duration in sec.). (c)Test your sin_NU function with the input parameter values .... anddisplay the result using the plot function. List of basic digitalsignals to generate: - Dirac (Unit Response) - Unit step (Heavisidestep) - Sign - Rectangle - Sine - Sine cardinal Exercise 2.2: Audioaliasing To illustrate the aliasing phenomenon, let’s perform twosimple experiments allowing us to “hear” it. Using the sin_NUfunction of Exercise 1: (a) Generate two 1 kHz sine signals (2seconds duration), first signal at 20 kHz sample frequency andsecond signal at 1.5 kHz sample frequency; (b) On the same graph,use the plot function to display the two signals versus t in therange 0 < t < 5 msec.; (c) Listen to the two signals oneafter another using the function soundsc(x, fs); and (d) Give yourinterpretation of this listening. Exercise 2.3: QuantizationQuantization is done by replacing each value of an analog signalx(t) by the value of the nearest quantization level. To exemplifythis operation, let’s simulate an unipolar ADC (Analog to DigitalConverter) having the technical specifications: R = 10 Volts(full-scale range) and B = 3 (number of bits). (a) Write a MATLABfunction y = adc_NU(x, R, B) where x and y are vectors containingthe input signal and the quantized signal, respectively; (b) Testyour function with an input ramp signal ranging from -5 to 15 Volts(1 volt per step); and (c) On the same graph, use the plot and stemfunctions to display the input signal and quantized signal,respectively.

Answer & Explanation Solved by verified expert
4.1 Ratings (800 Votes)
Hello Please find the answers tillexercise 22 attached below If the answer has helped you pleasegive a double thumbs up rating Thank you and havea nice dayFor part a please provide the table1bThe function definition isfunction x    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students