Skip to main content
Tweeted twitter.com/StackMma/status/1356120117218844673
Became Hot Network Question
edited tags
Link
Routine clean-up
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

sampling Sampling and filtering data

I'm trying to teach myself about sampling and filtering --- and I'm not sure if I'm misunderstanding the concepts or misapplying the mmaWolfram Language. I started by creating a simple test signal with contributions at 2 and 3 Hz,

f[t_] := Sin[6 Pi t] + Cos[4 Pi t]  

I then created a data set of sampled points

\[Tau]τ = 1/6.5;  
freq = Table[n, {n, -15, 15, \[Tau]τ}]; 
data = Table[f[n], {n, -15, 15, \[Tau]τ}]; 

Plotting the FTFourier transform

combine = Partition[Riffle[freq, Abs[Fourier[data]]],2];
ListLinePlot[combine, PlotRange -> {{-7, 7}, All}]

gives   

enter image description here

which is not peakedpeaking at either 3 or 2 Hz. Furthermore, when I plot

filtered = LowpassFilter[Abs[Fourier[data]], 2.5*Pi]

no discernible filtering occurs. Please --, what am I doing wrong?

TIA!

sampling and filtering data

I'm trying to teach myself about sampling and filtering --- and I'm not sure if I'm misunderstanding the concepts or misapplying the mma. I started by creating a simple test signal with contributions at 2 and 3 Hz,

f[t_] := Sin[6 Pi t] + Cos[4 Pi t]  

I then created a data set of sampled points

\[Tau] = 1/6.5;  
freq = Table[n, {n, -15, 15, \[Tau]}]; 
data = Table[f[n], {n, -15, 15, \[Tau]}]; 

Plotting the FT

combine = Partition[Riffle[freq, Abs[Fourier[data]]],2];
ListLinePlot[combine, PlotRange -> {{-7, 7}, All}]

gives  enter image description here

which is not peaked at either 3 or 2 Hz. Furthermore, when I plot

filtered = LowpassFilter[Abs[Fourier[data]], 2.5*Pi]

no discernible filtering occurs. Please -- what am I doing wrong?

TIA!

Sampling and filtering data

I'm trying to teach myself about sampling and filtering and I'm not sure if I'm misunderstanding the concepts or misapplying Wolfram Language. I started by creating a simple test signal with contributions at 2 and 3 Hz,

f[t_] := Sin[6 Pi t] + Cos[4 Pi t]  

I then created a data set of sampled points

τ = 1/6.5;  
freq = Table[n, {n, -15, 15, τ}]; 
data = Table[f[n], {n, -15, 15, τ}]; 

Plotting the Fourier transform

combine = Partition[Riffle[freq, Abs[Fourier[data]]],2];
ListLinePlot[combine, PlotRange -> {{-7, 7}, All}]

gives 

enter image description here

which is not peaking at either 3 or 2 Hz. Furthermore, when I plot

filtered = LowpassFilter[Abs[Fourier[data]], 2.5*Pi]

no discernible filtering occurs. Please, what am I doing wrong?

deleted 2 characters in body
Source Link

I'm trying to teach myself about sampling and filtering --- and I'm not sure if I'm misunderstanding the concepts or misapplying the mma. I started by creating a simple test signal with contributions at 2 and 3 Hz,

`f[t_]f[t_] := Sin[6 Pi t] + Cos[4 Pi t].  

I then created a data set of sampled points

\[Tau] = 1/6.5;  
freq = Table[n, {n, -15, 15, \[Tau]}]; 
data = Table[f[n], {n, -15, 15, \[Tau]}]; 

Plotting the FT

combine = Partition[Riffle[freq, Abs[Fourier[data]]],2];
ListLinePlot[combine, PlotRange -> {{-7, 7}, All}]

gives enter image description here

which is not peaked at either 3 or 2 Hz. Furthermore, when I plot

filtered = LowpassFilter[Abs[Fourier[data]], 2.5*Pi]

no discernible filtering occurs. Please -- what am I doing wrong?

TIA!

I'm trying to teach myself about sampling and filtering --- and I'm not sure if I'm misunderstanding the concepts or misapplying the mma. I started by creating a simple test signal with contributions at 2 and 3 Hz,

`f[t_] := Sin[6 Pi t] + Cos[4 Pi t].  

I then created a data set of sampled points

\[Tau] = 1/6.5;  
freq = Table[n, {n, -15, 15, \[Tau]}]; 
data = Table[f[n], {n, -15, 15, \[Tau]}]; 

Plotting the FT

combine = Partition[Riffle[freq, Abs[Fourier[data]]],2];
ListLinePlot[combine, PlotRange -> {{-7, 7}, All}]

gives enter image description here

which is not peaked at either 3 or 2 Hz. Furthermore, when I plot

filtered = LowpassFilter[Abs[Fourier[data]], 2.5*Pi]

no discernible filtering occurs. Please -- what am I doing wrong?

TIA!

I'm trying to teach myself about sampling and filtering --- and I'm not sure if I'm misunderstanding the concepts or misapplying the mma. I started by creating a simple test signal with contributions at 2 and 3 Hz,

f[t_] := Sin[6 Pi t] + Cos[4 Pi t]  

I then created a data set of sampled points

\[Tau] = 1/6.5;  
freq = Table[n, {n, -15, 15, \[Tau]}]; 
data = Table[f[n], {n, -15, 15, \[Tau]}]; 

Plotting the FT

combine = Partition[Riffle[freq, Abs[Fourier[data]]],2];
ListLinePlot[combine, PlotRange -> {{-7, 7}, All}]

gives enter image description here

which is not peaked at either 3 or 2 Hz. Furthermore, when I plot

filtered = LowpassFilter[Abs[Fourier[data]], 2.5*Pi]

no discernible filtering occurs. Please -- what am I doing wrong?

TIA!

Source Link
Loading