Logs: freenode/#haskell
| 2021-03-03 10:47:54 | edwlan | is now known as fiddlerwoaroof |
| 2021-03-03 10:48:04 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-03-03 10:48:08 | <Habib> | hmm… still won't let me upgrade tho |
| 2021-03-03 10:49:12 | <Habib> | hmm… i wonder if the upgrade step on the backend worked even though it just presented the auth dialog again, and then i was able to login after that |
| 2021-03-03 10:49:15 | × | wmacmil quits (~wmacmil@c83-248-104-92.bredband.comhem.se) (Ping timeout: 265 seconds) |
| 2021-03-03 10:49:20 | fiddlerwoaroof | is now known as edwlan |
| 2021-03-03 10:49:33 | edwlan | is now known as fiddlerwoaroof |
| 2021-03-03 10:50:20 | × | cgadski quits (~textual@a95-95-106-208.cpe.netcabo.pt) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-03-03 10:50:21 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-03 10:50:43 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-03 10:52:34 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 260 seconds) |
| 2021-03-03 10:52:42 | → | cgadski joins (~textual@a95-95-106-208.cpe.netcabo.pt) |
| 2021-03-03 10:59:34 | × | sablib quits (~sablib@171.113.165.91) (Read error: Connection reset by peer) |
| 2021-03-03 10:59:37 | → | elfets joins (~elfets@37.201.23.96) |
| 2021-03-03 10:59:57 | × | cgadski quits (~textual@a95-95-106-208.cpe.netcabo.pt) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-03-03 11:00:08 | → | sablib joins (~sablib@59.173.154.87) |
| 2021-03-03 11:05:36 | × | poscat quits (~poscat@123.116.89.28) (Ping timeout: 240 seconds) |
| 2021-03-03 11:07:09 | → | whyohwhy joins (9353c965@clients-xsf-101.upc.es) |
| 2021-03-03 11:07:10 | → | poscat joins (~poscat@123.116.89.28) |
| 2021-03-03 11:08:02 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 2021-03-03 11:08:21 | → | wmacmil joins (~wmacmil@84.216.157.27) |
| 2021-03-03 11:09:57 | × | graf_blutwurst quits (~user@adsl-178-38-234-220.adslplus.ch) (Remote host closed the connection) |
| 2021-03-03 11:10:24 | <whyohwhy> | Hi all! Quick question regarding traversing lists: I want to apply a sliding overlapping window with certain coefficients ([Float] with length n), to a long input data ([Int] with length k). I am thinking on a recursive process of "take n xs", "zipWith * win ()" and "drop n/2 xs", but to me it seems as if i'm falling into a trap by my knowledge of |
| 2021-03-03 11:10:24 | <whyohwhy> | other programming languages. To obtain the results, I would also have to append, and at the same time recursively call this function until all the input data has been processed. |
| 2021-03-03 11:10:41 | <mananamenos> | hi, i've just installed haskell-server-language from nixpkgs many things seems to work. However, creating a new module, I get this error: LSP :: No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for src/Foo.hs. |
| 2021-03-03 11:10:56 | → | graf_blutwurst joins (~user@2001:171b:226e:adc0:cc81:8132:7f95:7a39) |
| 2021-03-03 11:12:15 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 240 seconds) |
| 2021-03-03 11:13:13 | <mouseghost> | whyohwhy, overlapping? |
| 2021-03-03 11:13:46 | <whyohwhy> | mouseghost The window moves n/2 every iteration, instead of n if there was no overlap |
| 2021-03-03 11:14:13 | <Boomerang> | Is the output twice as long as the input? |
| 2021-03-03 11:15:23 | <whyohwhy> | Yes, approximately depending on if the number of input samples are a multiple of the window size |
| 2021-03-03 11:15:53 | <mouseghost> | whyohwhy, does it start aligned? |
| 2021-03-03 11:16:08 | <mouseghost> | and end so? |
| 2021-03-03 11:17:38 | <mouseghost> | it sounds to me like you could change the window from n to n/2 length, but idk, maybe im seeing it wrong |
| 2021-03-03 11:17:38 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-03 11:17:48 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-03 11:18:10 | <whyohwhy> | it starts aligned, yes |
| 2021-03-03 11:18:37 | <Boomerang> | > let slidy _ [] = []; slidy window xs = zipWith (*) window xs ++ slidy window (drop (length window `div` 2) xs) in slidy [1..4] [1..10] |
| 2021-03-03 11:18:39 | <lambdabot> | [1,4,9,16,3,8,15,24,5,12,21,32,7,16,27,40,9,20] |
| 2021-03-03 11:18:58 | <whyohwhy> | Can I post links to images? |
| 2021-03-03 11:19:45 | <whyohwhy> | Boomerang the result would need to be segmented though, but I guess that can be done afterwards as they are equally spaced segments |
| 2021-03-03 11:19:57 | <whyohwhy> | Hmmm let me try to understand the code |
| 2021-03-03 11:20:04 | <Boomerang> | Ah so you don't append? |
| 2021-03-03 11:20:15 | <Boomerang> | That should be easier then :) |
| 2021-03-03 11:20:23 | <whyohwhy> | The result needs to be FFT'ed afterwards |
| 2021-03-03 11:20:31 | <Boomerang> | > let slidy _ [] = []; slidy window xs = zipWith (*) window xs : slidy window (drop (length window `div` 2) xs) in slidy [1..4] [1..10] |
| 2021-03-03 11:20:32 | <whyohwhy> | This is part of the Short-time fourier transform |
| 2021-03-03 11:20:34 | <lambdabot> | [[1,4,9,16],[3,8,15,24],[5,12,21,32],[7,16,27,40],[9,20]] |
| 2021-03-03 11:21:00 | <whyohwhy> | So i'm guessing having it segmented is more efficient for the processing afterwards |
| 2021-03-03 11:21:55 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-03-03 11:22:26 | × | mayleesia quits (4d0b95c6@dynamic-077-011-149-198.77.11.pool.telefonica.de) (Quit: Connection closed) |
| 2021-03-03 11:23:04 | <whyohwhy> | Boomerang that looks about what I'd expect, yes! I will try with the rest of the code and see if the result is mathematically correct. Thanks a bunch! |
| 2021-03-03 11:23:29 | <Boomerang> | If you need it segmented you might as well avoid appending :) What I wrote is exactly what you described originally ^^ |
| 2021-03-03 11:23:47 | <whyohwhy> | The main problem I'm having with Haskell is in the little details |
| 2021-03-03 11:23:58 | → | __monty__ joins (~toonn@unaffiliated/toonn) |
| 2021-03-03 11:23:58 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-03-03 11:24:34 | <Boomerang> | Performance wise this is probably fine if you need it to be a list. But if you're in FFT land you might want to think if a list is the best data structure |
| 2021-03-03 11:24:48 | <whyohwhy> | The idea is to move this through clash to VHDL |
| 2021-03-03 11:25:02 | <Boomerang> | Oh then you need to use a Vec |
| 2021-03-03 11:25:08 | <Boomerang> | Clash doesn't synthesise lists |
| 2021-03-03 11:25:15 | <whyohwhy> | ouch good to know before I begin |
| 2021-03-03 11:27:13 | <Boomerang> | Unfortunately this kind of transformation on Vec is not the most straight forward to implement because it heavily relies on types for the lengths |
| 2021-03-03 11:28:24 | <whyohwhy> | You mean vec works bitwise? |
| 2021-03-03 11:28:31 | <Boomerang> | whyohwhy, maybe #clash-lang would be a better place to ask questions. But can you give more information about how the data is coming in, are you applying one window per cycle/all at once |
| 2021-03-03 11:28:46 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 276 seconds) |
| 2021-03-03 11:29:49 | <whyohwhy> | Boomerang I wanted to start from the beginning with pure Haskell, and then move it to Clash, which is why I'm first doing a simulation in pure Haskell to see how it would work. But yes, seems like in this case having the final system in mind has a lot of repercussions on how I approach the problem. |
| 2021-03-03 11:30:20 | <Boomerang> | Clash can't synthesis lists because it doesn't statically know what resources it needs |
| 2021-03-03 11:30:21 | × | plutoniix quits (~q@184.82.199.169) (Quit: Leaving) |
| 2021-03-03 11:30:36 | <Boomerang> | You can still simulate clash code with Vec in pure Haskell |
| 2021-03-03 11:30:58 | <whyohwhy> | In the FPGA, the samples will come serially, and the windowing should happen when the n samples have been ingested |
| 2021-03-03 11:31:27 | <Boomerang> | Nice! And then output the n*2 samples at once? |
| 2021-03-03 11:31:40 | <whyohwhy> | Yes, that was very very important. I will start again with Vec of course |
| 2021-03-03 11:32:14 | <whyohwhy> | I think it will be more efficient if the n samples are output as they arrive, because then they can start being FFT'ed for posterior processing |
| 2021-03-03 11:32:22 | <whyohwhy> | then at some point all of that will go to the DMA |
| 2021-03-03 11:33:28 | <Boomerang> | Would the windowing/multiplication I would use a mealy machine (there is a clash function for this) |
| 2021-03-03 11:33:45 | <whyohwhy> | I still have mealy machines on my to-do list |
| 2021-03-03 11:33:59 | <Boomerang> | Then use 2 Vec as part of your state (so you can accumulate input with the offset) |
| 2021-03-03 11:34:35 | <Boomerang> | I think you can get away with only using 2 multipliers that way |
| 2021-03-03 11:35:13 | <whyohwhy> | one for the sample*window coef and the other ? |
| 2021-03-03 11:35:32 | <whyohwhy> | shifting? |
| 2021-03-03 11:35:43 | <Boomerang> | Oh yeah sorry I was assuming the window coeficients were static. Are they? |
| 2021-03-03 11:36:10 | <whyohwhy> | The window can be in a register, as it will be static yes |
| 2021-03-03 11:36:14 | <Boomerang> | And yes shifting. If your input comes in serially sample by sample, you need to shift them into the Vecs in your state |
| 2021-03-03 11:36:15 | → | romesrf joins (~romesrf@44.190.189.46.rev.vodafone.pt) |
| 2021-03-03 11:36:15 | <whyohwhy> | Both the length and coefficients |
| 2021-03-03 11:36:45 | <whyohwhy> | Understood! |
| 2021-03-03 11:36:59 | <whyohwhy> | I don't want to bother you any more, I'll get to work with all this new information |
| 2021-03-03 11:37:04 | <whyohwhy> | Thanks a lot! |
| 2021-03-03 11:37:30 | <Boomerang> | For the output type, you'll probably want to output `Maybe (Vec n a)` |
| 2021-03-03 11:37:36 | <romesrf> | hey! i was wondering if anyone knew how to get the first number that satisfies a condition |
| 2021-03-03 11:38:17 | <romesrf> | i have "divisibleByList x [1..20]" return True or False if x is divisible by all numbers from 1 to 20 |
| 2021-03-03 11:38:45 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 2021-03-03 11:39:02 | <romesrf> | I want to try multiple numbers of x until the condition is satisfied, and was trying something like > take 1 [x | x <- [20..], divisibleByList x [1..20]] |
| 2021-03-03 11:39:23 | → | Feuermagier joins (~Feuermagi@2a02:2488:4211:3400:246e:bf09:8453:9d6) |
| 2021-03-03 11:40:00 | <whyohwhy> | Boomerang duly noted! Thanks again for everything! |
| 2021-03-03 11:40:41 | <Boomerang> | whyohwhy, do ask more questions if you need. Getting started in Clash can be hard |
| 2021-03-03 11:40:54 | <xsperry> | :t takeWhile -- romesrf |
| 2021-03-03 11:40:55 | <lambdabot> | (a -> Bool) -> [a] -> [a] |
| 2021-03-03 11:41:11 | <whyohwhy> | Boomerang I probably will, it seems a bit daunting |
| 2021-03-03 11:44:57 | × | tessier quits (~treed@kernel-panic/copilotco) (Ping timeout: 256 seconds) |
All times are in UTC.