Question

Calculate the 1D DCT of signal x[n]=[1, 2, 3, 4]

Calculate the 1D DCT of signal x[n]=[1, 2, 3, 4]

Homework Answers

Answer #1

% Matlab Code

y=[1,2,3,4];
[M,N]=size(y);
sum=0;
dct1d=zeros(1,N);
u=[0:N-1] ;
for j=1:N
for i=1:N
sum = sum + y(i).*(cos((pi.*(2.*u(i)+1).*u(j))/(2*N)));
end
if j==1   
K=sqrt(1/N);
else
K=sqrt(2/N);
end

dct1d(j)=K.*sum;
sum=0;
end
dct1d

Output Snapshot:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
a. A digital signal x(n) is defined as x(n)=u(n+5)-u(n-5) Calculate the signal x1(n)=x(-2n-6) by direct method,...
a. A digital signal x(n) is defined as x(n)=u(n+5)-u(n-5) Calculate the signal x1(n)=x(-2n-6) by direct method, represent the signal in sequence form and sketch the signal. b. By performing combination of time shifting and time scaling of x(n) how x1(n) can be generated? Plot the waveforms in matlab for each step.
Given the real signal: x [n] = [1, -2,0,1], indicate the correct alternative: a) The DFT...
Given the real signal: x [n] = [1, -2,0,1], indicate the correct alternative: a) The DFT of the signal with 6 points is [0, -1 + 1.7321j, 3 + 1.7321j, 2.3-1.7321j, -1-1.7321j] b) The DFT of the signal with 5 points is: [0,0,0, j, -j] c) The DFT of the signal with 7 points does not allow the original signal to be recovered. d) The DFT of the signal with 4 points is: x [n] = [-2, -1 + 1j,...
Given an input signal x[n], and the impulse response h[n], compute the output signal. x[n] =...
Given an input signal x[n], and the impulse response h[n], compute the output signal. x[n] = a^n * u[1-n]          for |a| > 1 h[n] = u[2-n]
1. Let ??(??) = ??(??) + 2??(?? ? 1) ? ??(?? ? 3) and ?(??) =...
1. Let ??(??) = ??(??) + 2??(?? ? 1) ? ??(?? ? 3) and ?(??) = 2??(?? + 1) + 2??(?? ? 1) . Compute and plot each of the following convolutions: (a) y1(n) = x(n) * h(n) (b) y2(n) = x(n+2) * h(n) (c) y3(n) = x(n) * h(n+2) (d) Now consider the signal ??(??) = ( 1/ 3 ) ^(??) *?????? (( ?? /4)* ??) ??(??). Evaluate the z-transform of this signal and specify the corresponding region of...
1. Find f''(x) F(x)= (x^2+2)^9 F''(x)= 2. Find t^(4)(n) for the function t(n)= 2n^-1/2+7n^3/2 t^(4)(n) =...
1. Find f''(x) F(x)= (x^2+2)^9 F''(x)= 2. Find t^(4)(n) for the function t(n)= 2n^-1/2+7n^3/2 t^(4)(n) = (Type an expression using n as the variable. Simplify your answer)
Consider the signal x(t) = 3 cos 2π(30)t + 4 . (a) Plot the spectrum of...
Consider the signal x(t) = 3 cos 2π(30)t + 4 . (a) Plot the spectrum of the signal x(t). Show the spectrum as a function of f in Hz. ?π? For the remainder of this problem, assume that the signal x(t) is sampled to produce the discrete-time signal x[n] at a rate of fs = 50 Hz. b Sketch the spectrum for the sampled signal x[n]. The spectrum should be a function of the normalized frequency variable ωˆ over the...
Find the radius and interval of convergence of 1.(a) ∞∑n=0 ((((−1)^n)*n)/(4^n))*(x−3)^n (b)∞∑n=0 n!(x−2)^n
Find the radius and interval of convergence of 1.(a) ∞∑n=0 ((((−1)^n)*n)/(4^n))*(x−3)^n (b)∞∑n=0 n!(x−2)^n
Problem 6. 1. If X ~ N(9; 4), find Pr(|X - 2 |< 4). 2. If...
Problem 6. 1. If X ~ N(9; 4), find Pr(|X - 2 |< 4). 2. If X ~ N(0; 1), find Pr(|X + 3|> 5). 3. If X ~ N(-2; 9), find the number c such that Pr(|X + 2| < c) = 0:5.
b) Find the least integer n such that f(x) is O(x^n) for f(x) = (x^4+x^2+1)/( x^3...
b) Find the least integer n such that f(x) is O(x^n) for f(x) = (x^4+x^2+1)/( x^3 +1)
Find the radius and interval of convergence of 1.(a) ∞∑n=0 ((((−1)^n)*n)/(4^n))*(x−3)^n (b)∞∑n=0 n!(x−2)^n SHOW WORK
Find the radius and interval of convergence of 1.(a) ∞∑n=0 ((((−1)^n)*n)/(4^n))*(x−3)^n (b)∞∑n=0 n!(x−2)^n SHOW WORK