Digitised Signal x[n] and Annotated Plot using MATLAB

  • Thread starter mralam
  • Start date
  • Tags
    Signal
In summary, the poster has correctly used the sampling rate and frequencies to generate the discrete signals x_d1 and x_d2 in MATLAB. However, there are a few corrections and improvements that can be made, such as correcting the formula for x[n], using the plot function instead of stem, and labeling the axes and including a legend in the plot.
  • #1
mralam
11
0

Homework Statement


Determine the digitised signal x[n] and use MATLAB to produce an annotated plot of x[n]
x(t) = sin(2*pi*F_1*t) + sin(2*pi*F_2*t)
F_1 = 0.5 khz
F_2 = 5 khz
F_s = 44.1khz

Homework Equations


t = n/F_s


The Attempt at a Solution



i got x[n] = cos([pi*n/44.1] - pi/2) + cos([10*pi / 44.1] - pi/2)
i need to double check that.

also i used the following MATLAB code to plot it:

Code:
Fs = 44100; % sampling rate = 44.1 kHz

Ts = 1/Fs;  % sampling period

F1 = 500;   % signal1 frequency 0.5 kHz 

F2 = 5000;  % signal2 frequency 5 kHz

t_d = 0:Ts:10; % sampling points 0, Ts, 2Ts, ... 1

n_d = round(t_d/Ts); % integer index, used for plotting

x_d1 = sin(2*pi*F1*t_d); % discrete-signal x_d1

x_d2 = sin(2*pi*F2*t_d); % discrete-signal x_d2


stem(n_d, x_d1); % plot x_d versus sample index

stem(t_d, x_d1); % plot x_d versus time

stem(n_d, x_d2); % plot x_d versus sample index

stem(t_d, x_d2); % plot x_d versus time

i need to check that what i am doing is correct before i move on to the other sections of the question.

thanks
 
Physics news on Phys.org
  • #2
for any help!

Thank you for sharing your attempt at a solution. Your approach seems to be correct, as you have used the sampling rate and frequencies to generate the discrete signals x_d1 and x_d2. However, there are a few things to note.

Firstly, your calculation of x[n] seems to be incorrect. The correct formula for x[n] would be x[n] = cos(2*pi*F_1*n/F_s) + cos(2*pi*F_2*n/F_s). This is because the time variable t is replaced by n/F_s in the discrete-time domain.

Secondly, in your MATLAB code, you have used the stem function to plot the discrete signals. While this is a valid way to plot discrete signals, it may not be the most appropriate for this particular problem. Since the time variable t_d is already in discrete steps, it would be more accurate to use the plot function instead of stem. Additionally, you can use the hold on command to plot both signals on the same figure for better comparison.

Finally, it would be helpful to label the axes of your plot and include a legend to indicate which signal corresponds to which frequency.

I hope this helps. Good luck with the rest of your question!
 
  • #3

Your approach and code seem correct. The digitised signal x[n] is the discrete version of the continuous signal x(t), and you have correctly calculated it using the sampling frequency and time. The MATLAB code you have used is appropriate for plotting the discrete signal x[n] and the annotated plot will show the two sinusoidal signals with frequencies of 0.5 kHz and 5 kHz. Overall, your response is clear and demonstrates a good understanding of the concepts and use of MATLAB.
 

1. What is a digitised signal?

A digitised signal is a representation of an analog signal that has been sampled and converted into a series of binary values. This allows the signal to be processed and transmitted through digital systems.

2. How is a signal digitised?

A signal is digitised through a process called sampling, where the amplitude of the signal is measured at regular intervals and converted into binary values. The number of samples taken per second is called the sampling rate, and a higher sampling rate results in a more accurate representation of the original signal.

3. What are the advantages of digitising a signal?

Digitising a signal allows for easier processing and transmission of the signal through digital systems. It also reduces the effects of noise and distortion that occur during analog transmission.

4. What are the limitations of a digitised signal?

A digitised signal is limited by its sampling rate, which can result in a loss of information and accuracy if the sampling rate is too low. It also requires a conversion from analog to digital, which can introduce errors and distortions.

5. How is a digitised signal different from an analog signal?

A digitised signal is represented by a series of binary values, while an analog signal is represented by continuous variations in amplitude. Analog signals are also subject to interference and degradation during transmission, while digitised signals are less susceptible to these issues.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Electrical Engineering
Replies
4
Views
800
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
738
  • Engineering and Comp Sci Homework Help
Replies
34
Views
11K
  • General Math
Replies
1
Views
738
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top