Write a Matlab code to generate Gold code and test its cross and auto correlation properties
# Make a shift register of length 10
# initilize with all 1's
G1 = [1 for i in xrange(10)]
print G1
fb3 = G1[3-1] # position 3
fb10 = G1[10-1] # position 10
fb = (fb3 + fb10) % 2 # modulo 2 add
print fb
# shift everything one place to the right
for i in reversed(range(len(G1[1:]))):
G1[i+1] = G1[i]
# feedback
G1[0] = fb
print G1
fb = (G1[3-1] + G1[10-1]) % 2
for i in reversed(range(len(G1[1:]))):
G1[i+1] = G1[i]
G1[0] = fb
print G1
def shift(register, feedback, output):
"""GPS Shift Register
:param list feedback: which positions to use as feedback (1 indexed)
:param list output: which positions are output (1 indexed)
:returns output of shift register:
"""
# calculate output
out = [register[i-1] for i in output]
if len(out) > 1:
out = sum(out) % 2
else:
out = out[0]
# modulo 2 add feedback
fb = sum([register[i-1] for i in feedback]) % 2
# shift to the right
for i in reversed(range(len(register[1:]))):
register[i+1] = register[i]
# put feedback in position 1
register[0] = fb
return out
# example:
print shift(G1, [3,10], [10])
print G1
Write a Matlab code to generate Gold code and test its cross and auto correlation properties
Part a: Write a Matlab code that generate Exponential Function. Part b Write a Matlab code that generate sinusoidal Function. Part c Write a Matlab code that generate Unit Ramp delay (shift) function
Matlab -------- Write a code to generate the first n positive multiples of 5, where n is provided by the user.
Q: please solve using matlab code withe comment 1. Write the Matlab code to generate: x = cos(w1*t) + cos(w2*t); where, w1=7; w2=23; t = [0:0.005:2] 2. Plot the signal using sub plot a. in time domain b. in frequency domain 3) Sample the signal under different sampling conditions: a. Ts<1/2fm b. Ts=1/2fm c. Ts>1/2fm 4). Multiple plot: the signal sampled under sampling condition and the signal x a. in time domain b. in frequency domain c. Label and Title...
Write the Matlab code to model and generate the surfaces using boundaries. Question given below is to be solved using matlab Determine the point on the bilinear surface defined by P(0,0)=[0 0 1], P(0,1)=[1 1 1],P(1,0)=[1 0 0],P(1,1)=[0 1 0], corresponding to u=v=0.5 in parametric space.
Need help with this MATLAB question
4.4 (25 points) Write and test the code for the function mysteryFunction that takes a vector, V, generate a new vector W, in which each element is the sum of the corresponding element in V and the previous element of V, and return two values (mysteryMean, mysteryStdev] of W. Consider the previous element of V(1) to be 0. For example, [mysteryMean, mysteryStdev] = mysteryFunction(1:8), W= [1 3 5 7 9 11 13 15] mysteryFunction...
write a matlab code where you repeatedly create a multiple of N and test if all digits are 9 or 0
using matlab
Perform the following using Matlab For an additive Gaussian noise: a. Generate 4000 samples with mean value of 3 and variance of 9. b. Plot the sample values using two different ways. c. Determine the actual mean, variance, and standard deviation. d. Determine the median, mode, and range. e. Sketch the histogram. tle- enerate and plot the probability density function (pdf) and its corresponding cumulative distribution function (cdf) ror he M For the following two signals: / and...
Part A: Write a generic Matlab code that generates delayed (shifted) Unit Impulse function. Part B: Write a generic Matlab code that generates delayed (shifted) Unit step function. Part C: Write a generic Matlab code that generate delayed (shifted) Unit ramp function.
Write a MATLAB code to generate an array of 100 random integers between 1 and 10 using the command “randi”. Using “if” statement, impose the condition that if a number in the array is greater than 5, the number is modified as, number = number – 11. Find the sum of the array and store it. Repeat this exercise for 10, 1000 and 100000 trials and plot the following: (a) Sums obtained vs trails number (b) Histogram of the sum...
write a matlab code
Write a MATLAB function to check the stability of a digital filter described by its coefficients. Syntax: stable (b, a); where b and a are the system's forward and backward coefficient. Hint: The roots() function might be useful. Returned value: None. Operation: Displays either 'Stable' or 'Not Stable' message and plots the z-plane. Test with Case#1: y(n)= 2x (n) +x (n-1) +0.4y (n-1) - 0.6y (n-2) Case#2: y(n)= x(n) +0.5x (n-1) +2x (n-2)- y(n-1) +y (n-2)...