Message Boards Message Boards

0
|
5386 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Filtering Data

Posted 10 years ago
I have taken a DFT of some data points I called "v" which was a 193 data points.
a = Fourier[{v}, FourierParameters -> {1, 1}];
The Fourier returned a 193 data points. As it turned out, I don't need all of them. In the output, how can tell Mathematica to index points 90 to a 105 to be 0? In other words, instead of having to painstakingly count and find out which points are between 90 and 105, Mathematica does it automatically sets them to 0.

Thank you in advance.
POSTED BY: sean roubion
Posted 10 years ago
You can write- 
In[4]:= b = ReplaceList[Take[a[[1]], {90, 105}], {x__, ___} -> 0]

Out[4]= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
And then,
Join[Take[a[[1]], 89], b, Take[a[[1]], {106, 193}]]
to get the list.
POSTED BY: Girish Arabale
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract