2023-08-22 14:39:29 +00:00
|
|
|
#programming-language #research
|
|
|
|
|
|
|
|
|
2023-08-25 08:56:00 +00:00
|
|
|
## 先行例
|
2023-08-24 11:45:03 +00:00
|
|
|
|
|
|
|
[[Faust]]
|
2023-08-22 14:39:29 +00:00
|
|
|
|
|
|
|
|
2023-08-24 11:45:03 +00:00
|
|
|
[[The w-calculus a synchronous framework for the verified modelling of digital signal processing algorithms]]
|
2023-08-22 14:39:29 +00:00
|
|
|
|
2023-08-24 11:45:03 +00:00
|
|
|
## 基礎知識
|
|
|
|
|
2023-08-24 12:45:03 +00:00
|
|
|
[[Coqの勉強]]
|
2023-08-26 09:27:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
## mimiumと多段階計算
|
|
|
|
|
|
|
|
こういうのが計算できなかった
|
|
|
|
|
|
|
|
```rust
|
|
|
|
|
|
|
|
fn filterbank(N,input,lowestfreq, margin,Q,filter){
|
|
|
|
if(N>0){
|
|
|
|
return filter(input,lowestfreq+N*margin,Q)
|
|
|
|
+ filterbank(N-1,input, lowestfreq,margin,Q,filter)
|
|
|
|
}else{
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
仮に多段階計算だとしてちょっと型を明示してみる
|
|
|
|
まあ〜書きづらいよな
|
|
|
|
|
|
|
|
```rust
|
|
|
|
|
2023-08-27 07:19:59 +00:00
|
|
|
fn gen_filterbank(N:int,lowestfreq:float, margin:float,Q:float,filter:float->float)-> <float->float> {
|
2023-08-26 09:27:50 +00:00
|
|
|
// level:0
|
|
|
|
if(N>0){
|
|
|
|
< //level:1
|
|
|
|
|x| {
|
|
|
|
filter(x,~(lowestfreq+N*margin),~(Q))
|
|
|
|
+ ~( //level:0
|
|
|
|
gen_filterbank(N-1,x, lowestfreq,margin,Q,filter)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
>
|
|
|
|
|
|
|
|
}else{
|
|
|
|
<|x|{0}>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-27 07:19:59 +00:00
|
|
|
fn filterbank(input:float, N:int,lowestfreq:float, margin:float,Q:float,filter:float->float)-> float{
|
2023-08-26 09:27:50 +00:00
|
|
|
~(gen_filterbank(N,lowestfreq,margin,filter))(input)
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
filter同士の足し算を`+`の`infix`でやりたいよねえ
|
|
|
|
let多相じゃないよなあこれは
|
|
|
|
|