Question

In: Computer Science

Write a Matlab function called “SimpleChannel” which takes a signal as an input, simulates a channel...


Write a Matlab function called “SimpleChannel” which takes a signal as an input, simulates a channel and returns the transmitted signal.. SimpleChannel function will add a randomly generated noise (look for “rand” function) to the signal and return it. You can adjust the amplitude of the noise as you want in order to have a distinct noise effect. Then write another matlab code to show the channel noise. First create the signal and then simulate the channel by using your SimpleChannel function. Lastly plot the two signals in the same figure to show the effect of the noise.

Function : [Tran] = SimpleChannel(Rec)

The Signal : x(t) = 2 cos(2πt) + 3 cos(4πt)

Time interval : from 0s to 5s incremented by 0.01s

Note: Don’t forget to put title and label names.


Solutions

Expert Solution

clear
clc
close all
t=0:.01:5;
x=2*cos(2*pi*t) + 3*cos(4*pi*t);
noisy=SimpleChannel(x);
plot(t,x,'k','linewidth',2.5)
hold on
plot(t,noisy,'r')
xlabel('time')
ylabel('signal')
legend('original','noisy')
title('Simple Channel')

function [Tran] = SimpleChannel(Rec)
%you can change thse parameters as you wish
maxValue=1;
minValue = -1;
noise = minValue+(maxValue-minValue)*rand(size(Rec));
Tran = Rec+noise;

end


Related Solutions

A. Write a function in MATLAB called findTranspose that takes in as input any matrix or...
A. Write a function in MATLAB called findTranspose that takes in as input any matrix or any vector and simply returns back the transpose of that input. You can always verify your answer by using the inbuilt transpose function in MATLAB, however, you cannot use the transpose function directly when writing your code. Here is the starter code that we are providing to help you get started %x is the input vector or matrix. You can find the %size that...
B. Write a function in MATLAB called findInverseOf2x2Matrix that takes in as input any square matrix...
B. Write a function in MATLAB called findInverseOf2x2Matrix that takes in as input any square matrix of size 2 × 2 and returns back the inverse of that matrix if one exists. If no inverse exists, print back a suitable error message. You can safely assume that we will test your code on square matrices of size 2 × 2 only. You can always verify your answer by using the inbuilt inverse function in MATLAB, however, you cannot use the...
Write a function in Matlab that takes as input the number n and a symmetric tridiagonal...
Write a function in Matlab that takes as input the number n and a symmetric tridiagonal matrix given as two vectors: n×1 vector v representing the main diagonal and (n−1)×1 vector w representing the upper diagonal. Have this function output the Cholesky factor of the matrix as a vector for the main diagonal and a vector for the upper diagonal and output the number of flops and, separately, the number of square roots used as well. Use only basic programming....
Matlab Create/write a function that takes an input of x and y data, and a string...
Matlab Create/write a function that takes an input of x and y data, and a string (either linear? or quadratic), sets up a linear system of equations (Ax = b), and solves and plots the model.
Matlab Code that does the following: Takes as input 3 frequencies. Create a signal that is...
Matlab Code that does the following: Takes as input 3 frequencies. Create a signal that is a mixture of the 3 signals. Create a bandpass filter that only selects the center frequency. Output the filtered signal which contains only the middle frequency. Plot in time and frequency domain the original signal and the filtered signal. Show the output for filter order 1 and 15. Upload a pdf of the image files. Each figure should have your name in the title...
Using Matlab, write a function that takes numeric data as its input argument and prints a...
Using Matlab, write a function that takes numeric data as its input argument and prints a message to the Command Window stating if the number is positive, or negative, or 0. This function should transfer an output value to the Workspace ONLY when the input value is negative. Please include a copiable code and the associated screenshots.
Write a C function called weighted_digit_sum that takes a single integer as input, and returns a...
Write a C function called weighted_digit_sum that takes a single integer as input, and returns a weighted sum of that numbers digits. The last digit of the number (the ones digit) has a weight of 1, so should be added to the sum "as is". The second from last digit (the tens digit) has a weight of 2, and so should be multiplied by 2 then added to the sum. The third from last digit should be multiplied by 1...
Write a function cube_all_lc(values) that takes as input a list of numbers called values, and that...
Write a function cube_all_lc(values) that takes as input a list of numbers called values, and that uses a list comprehension to create and return a list containing the cubes of the numbers in values (i.e., the numbers raised to the third power). This version of the function may not use recursion.
MATLAB: Write a function called max_number that takes an at most two-dimensional matrix A as its...
MATLAB: Write a function called max_number that takes an at most two-dimensional matrix A as its sole input. The function returns the largest element of A. You are not allowed to use the built-in max function.
#Write a function called get_integer that takes as input one #variable, my_var. If my_var can be...
#Write a function called get_integer that takes as input one #variable, my_var. If my_var can be converted to an integer, #do so and return that integer. If my_var cannot be converted #to an integer, return a message that says, "Cannot convert!" # #For example, for "5" as the value of my_var, get_integer would #return the integer 5. If the value of my_var is the string #"Boggle.", then get_integer would return a string with the #value "Cannot convert!" # #Do not...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT