Public
Edited
Feb 13
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function bkfilter(pl, pu, n) {
return (x) => {
let a = 2*Math.PI/pu;
let b = 2*Math.PI/pl;
function bj(i) {
if (i===0) {
return (b-a)/Math.PI;
} else {
return (Math.sin(i*b) - Math.sin(i*a))/(i*Math.PI);
}
}
let sumbj = d3.sum(d3.range(-n, n+1).map(d => bj(d)))/(2*n+1);
return x.map((d,i,a) => {
if (i < n | i > x.length-n-1) {
return null;
} else {
return d - d3.sum(d3.range(-n, n+1).map(e => (bj(e)-sumbj)*a[i+e]));
}
}); }
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = await FileAttachment("Unemp-1.csv").csv({ typed: true });
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more