21 lines
448 B
Rust
21 lines
448 B
Rust
use firls_rs::{firls, frequency_shift_coeffs};
|
|
|
|
fn main() {
|
|
let coeffs = firls(
|
|
23,
|
|
8000.0,
|
|
&vec![(0.0, 1.0), (1200.0, 1.0), (1500.0, 0.0), (4000.0, 0.0)],
|
|
)
|
|
.unwrap();
|
|
|
|
let shifted = frequency_shift_coeffs(&coeffs, 8000.0, 1500.0);
|
|
|
|
println!("[");
|
|
for coeff in shifted.iter() {
|
|
println!("{} + {}j,", coeff.re, coeff.im);
|
|
}
|
|
println!("]");
|
|
|
|
println!("Lenght: {}", coeffs.len());
|
|
}
|