Public
Edited
Nov 4, 2023
1 star
Insert cell
Insert cell
Insert cell
wd({signal: [
{name: 'clock', wave: 'p...'},
{name: 'A1', wave: ['pw', {d: ['M',0,0, 'L',1,1, 'L',2,1, 'L',3,0, 'H',4]}]}
]})
Insert cell
Insert cell
wd({signal: [
{name: 'clock', wave: 'p.......'},
{name: 'A2', wave: ['pw', {d: [
'm',0,0,
'l',2,1,
'l',.5,-.5, 'h',.5,
'l',.5,-.5, 'h',.5,
'l',2,1,
'l',.5,-.5, 'h',.5,
'l',.5,-.5, 'h',.5,
]}]}
]})
Insert cell
Insert cell
wd({signal: [
{name: 'clock', wave: 'p..'},
{name: 'A2', wave: ['pw', {d: [
'm', 0,0,
'q', .5,1, 1,1,
'h', 1,
'q', .5,-1, 1,-1
]}]}
]})
Insert cell
wd({signal: [
{name: 'clock', wave: 'p.......'},
{name: 'sawtooth', wave: ['pw', {d: ['m',1,0, 'l',2,1, 'v',-1, 'l',2,1, 'v',-1]}]},
{name: 'triangle', wave: ['pw', {d: 'm,0,0 l,2,1 l,2,-1 l,2,1 l,2,-1'}]},
{name: 'RC', wave: ['pw', {d: 'm,0,0 q,.5,1,1,1 h,1 q,.5,-1,1,-1 h,1 q,.5,1,1,1 h,1'}]},
]})
Insert cell
wd({signal: [
{name: 'dummy', wave: '0.......'},
{name: 'sinA', wave: ['pw', {d: 'm,0,.5 q,.25,1,.5,0 t,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0,.5,0'}]},
{name: 'sinB', wave: ['pw', {d: 'm,0,.5 q,.25,1,.5,0 t' + ',.5,0'.repeat(15)}]},
{name: 'sinC', wave: ['pw', {d: 'm,0,.5 q,.5,1,1,0 t' + ',1,0'.repeat(5)}]},
]})
Insert cell
wd({signal: [
{name: 'pll_en', wave: '0.1.........0...'},
{name: 'pll_out', wave: ['pw', {
d: 'm,0,.5 h 4'
+ ' q,.5 ,1, 1,0 t,1,0'
+ ' q,.25,1,.5,0 t' + ',.5,0'.repeat(15)
+ ' h 2'
}]},
{name: 'pll_lock', wave: '0......1.....0..'},
]})
Insert cell
Insert cell
wd({signal: [
{name: 'data', wave: 'h.l...h.l.'},
{name: 'analog', wave: ['pw', {
d: 'm,0,.5'
+ ' q,.25, 1,.5,0 t' + ',.5,0'.repeat(3)
+ ' q,.25,-1,.5,0 t' + ',.5,0'.repeat(7)
+ ' q,.25, 1,.5,0 t' + ',.5,0'.repeat(3)
+ ' q,.25,-1,.5,0 t' + ',.5,0'.repeat(3)
}]},
]})
Insert cell
wd({signal: [
{name: 'dummy', wave: '0...'},
{
name: 'analog',
wave: ['pw', {d: [
'M',0,.5, // initial position
...Array.from({length: 64}).flatMap((_, i) =>
['L', i / 16, Math.sin(i * Math.PI / 8) / 2 + 0.5])
]}]
}
]})
Insert cell
wd({signal: [
{name: 'dummy', wave: '0................'},
{
name: 'analog',
wave: ['pw', {d: [
'M', 0, .5, 'L', 4, 0.5, // initial line
...Array.from({length: 180}).flatMap((_, i) =>
['L', 4 + i / 16, Math.cos(Math.log2(200 - i) * Math.PI * 10) / 2 + 0.5])
]}]
}
]})
Insert cell
wd((() => {
const sampler = arr => ['pw', {d: arr.flatMap((y, x) => [(x ? 'L' : 'M'), x / 32, y])}];
const line = Array.from({length: 512}, (_, i) => i / 512); // line
const sin = line.map((y, x) => Math.sin(3 * Math.PI * y) / 2 + 0.5); // Sin wave
const saw = line.map((y, x) => (y * 16) % 1); // SAW line
const pwm = sin.map((y, x) => (y > saw[x]) ? 1 : 0); // PWM
return {signal: [
{name: 'spacer', wave: '0...............'},
{name: 'line', wave: sampler(line)},
{name: 'sin', wave: sampler(sin)},
{name: 'saw', wave: sampler(saw)},
{name: 'pwm', wave: sampler(pwm)},
]};
})())
Insert cell
Relative moves
Insert cell
wd({signal: [
{name: 'inp', wave: '0..................'},
{name: 'req', wave: ['pw', {d: ['M',0,0,
'v',0, 'h',3.5,
'v',1, 'h',3.5,
'v',-1, 'h',12
]}]},
{name: 'ack', wave: ['pw', {d: ['M',0,0,
'v',0, 'h',12,
'v',1, 'h',3.5,
'v',-1, 'h',3.5
]}]}
]})
Insert cell
## (Ideas) Transition filter

```
transition ( expr [ , td [ , rise_time [ , fall_time [ , time_tol ] ] ] ] )
```
* `td` - delay
* `rise_time`
* `fall_time`

Insert cell
Insert cell
Insert cell
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