Problem 125. Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.
Example:
Input x = [ 1 2 3 2 1 2 3] Output y = [ -1 0 1 0 -1 0 1]
Solution Stats
Problem Comments
-
2 Comments
The Test Suite is not demonstrating removal of a DC component, as there is no way to identify the AC component in any of the tests! For example, Test 3 has x = 0:100, and from this we are supposed to obtain signalMean = 50. But without any observations to show that at earlier & later times the signal is decreasing with time, like x = [2 1 0:100 99 98], we have no way to know that more observations wouldn't have revealed, say, x = [2 1 0:100 101 102], for which signalMean = 51. And indeed we could get any arbitrary signalMean based on the limited observations in this Test Suite.
The DC component of a signal is usually its mean.
Solution Comments
Show commentsProblem Recent Solvers432
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15493 Solvers
-
Count from 0 to N^M in base N.
235 Solvers
-
496 Solvers
-
Implement simple rotation cypher
1054 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
373 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!