 If we have sound and everything is working okay, what's my mouth not moving? It's my mouth moving. It's my mouth moving just I think it has trouble in The dark is going into my stream Headphones stopped working I'm pretty sure it should be working better now. Why am I not opening my mouth enough? They'll check that thing later as well So what are we here mainly for today? Okay, I don't need to be monitoring my my own voice. I don't like it anyway We actually have a better voice here Right, that's right. Wait, I forgot to post about this stream Give me Let's do it now How do I yep, we got it in there Better monitor my continue monitoring my sound just in case let's do it a quick day I'll ignore the name change Let's also do to tweet Sorry to a LinkedIn. Okay, let's see So we have this to rule to do it should be similar to what we did yesterday It is back through except in this one will have options to remove some of the noise So the tool should look pretty much the same And Still using 3.5 a GPT 3.5 and understand. Yeah, trying to generate Rooms first Mainly so I don't reach the the prompt limit just currently sitting at 50 messages every three hours Well might as well we're already five minutes in and let's start Popping stuff in It's actually open another tab with the new tool. So it will replace this thing. We actually Generate an image out of this so that it goes to GPT a describe The image obviously Yes, it is a user in the face. You are absolutely right and now Yeah, we probably can close a GPT 3.5 Plot five, what's the plot five that it keeps? Oh, yeah, there is a plot five there And that's a bit odd. Yeah, you can ignore that for sure. And now we should have More context So IEG Yeah, that's the denoise will open this one as well. We already have an app for it this Won't run anyway. There's some oh, we obviously don't know why there's so many globals I suspect this was generated by a github co-pilot Okay, let's So we have the data file copied 10 times everywhere That we don't actually need Yeah, I'm pretty sure this was a github Can change the name index Index HTML is the this current thing That we should get Read off this was the old lab view Stuff HTML was generated It's not great at all really difficult to work with And so we can pop it into Ava It should be legit. This should be a better description Yeah, we can ignore the play speed and play button for now As we did in the current tool Where's that? This is a detailed description of a user interface and its functionality related to the analysis of EEG Electroencephalogram signals particularly focused on wavelet based noise removal and signal visualization in both the time and frequency domains Can I move my mouth as if it's me talking? The tool implies a wavelet based noise removal algorithm By default wavelet denoise and discrete wavelet transform are turned on When the discrete wavelet transform is turned off the underestimated wavelet transform is employed The interface allows users to observe changes within different frequency bands either by clicking play or by scrolling through the file And right So we stay Okay, this all Can go into other folder Oops It's already in Ava No, it's not in Ava Move What is making sense? Okay, let's Don't get it And let's open containing folder No, this should be All placed in Ava And yes, we have data Can only have The one file here not moving We are copying it Okay, I have this info Let's not Copy this Or should we should just copy A everything Right So we have that and we need the templates and static And yeah, the name the name would be different to remember to change the name Templates static And this is the app and this info file Is and she should be changed to that Yeah, won't worry about Play button or play speed for now We are creating a flash cap. Yeah, we have The tomb was a wavelet based noise removal algorithm. Yeah, that's right. We need that so we're creating a flash application Uh Yeah, we're not using live you anymore And just python And that's the source Of the data And that's correct Now input Have this file No, it's not through different Data files. It's through the same And same data that we loaded into And that is currently being loaded loaded data And yeah, we ignore the play button and play speed for now A channel number and that's correct window size yet default of 10 seconds is fine Yeah, we have the trend So that should bring the signal around zero sexually can be Ranging from zero to five. We tend to Uh, yeah larger filter water used to cause most of grief Toggle that when turned on always the non-filtered spectrum below of less Yeah, the whole spectrum And that's correct Frequency scale That's right Now this is the Important be it's probably just let's just put them in Uh first The wavelet denoise Yeah, these three Okay, so This is what we currently have. That's the simple frequency domain Review we're using the same data This is what we want Again, they ignore we'll ignore the play and play speed for now Yeah, we want this description as well Or is it already there? oops Yeah, we mentioned this at the bottom there Uh, this is the folder structure. That should be the same as we had for the previous tool This is by the way. What it used to look like Before we move to the new server So I think As all this already um This will be called Same name with denoise We can pop This one in Because we'll need to regenerate all these files Yeah, that's fine. We can delete Some of those Because that's what the problems We have the previous code And right, so we are obviously not ready to deploy anything because it will be At the moment the same As what we had for the previous tool for this one Um, let's run it locally just to see if it's working No wait Yeah, this one just have to make sure i'm not confusing between them just minimize The previous one Have the index for it Um static and the javascript Pop in the html Just so it has a context Yeah, we don't actually need a summary can manage Just for you for context Then we have This Shavascript Yeah, it's okay. We don't need to explain as well. The most important thing is this A python code Stop generating and now the trick questions. So We need this three to be A edit Yep, new parameters. Yeah, you're getting you're getting the You know what to do This is a python wavelet library and It's actually a confirm with A GitHub co-pilot Yep Yeah, obviously suggesting The same thing new parameters Yeah, so we don't have them in the html code yet Um, can you do that? So we're adding a new library this for Oops wavelet analysis We have those three variables Additional variables. Okay. Where shall we pick them? Do we normally put the Variables next to the function? I don't know. Okay in html I don't like the fact that it doesn't Then create a new function Okay in the form this should be clearer In wavelet settings There's another form Do we already have a form? This is an extra form Should it go? Um Now let's put it up top Can we pop it in there and let's run this So this is will be in the local environment, right? So that's how the development Thing will look like Yeah, we have the wavelet the noise fetch data Yeah, we're not using Ajax at the moment Okay, so another thing is Hey, we need some sort of noise a measurement thing because we have a noise performance Yeah, we like those We like additional output like this And right because I'm pretty sure the problem with this is if I tell it to regenerate the whole python It will stuff things up. I suspect that we will Remove some of the functionality that we already have I mean Don't think I can do it myself. So we'll have to just try it out if you don't And there are things We want to make sure So start popping Yeah, that that's what it didn't doesn't have yet Make sure the inputs updated after input changed changed by user a pop this in all the outputs are updated after any input changed by user and then We'll start regenerating the code Hopefully it doesn't mess up what we did prior Yeah, this is when a gpt4 becomes super slow and what what it means if it's just random or Am I overloading it already? Right. We don't need the code yet Can you because it mentioned a jacks to capture user input I have is not using Ajax Donut prime. I don't know Which one is better Do this at the end So the index html can just regenerate the whole code Okay, this has a lot of missing stuff. Why? Okay, stop. Stop. Stop. What's the Pro know how to make it a Update regenerate the whole code common changes within the code this Three how to make it Generate the whole thing. Oh come on. No, no, no, no, no It keeps ignoring me Adjusted doesn't have the current code. I don't like the update buttons You Must Update any other buttons Sure No update or any other buttons are used They'll stop generating Again, I don't know how to updated html file a comment Changes Okay, that's actually seem to be generating the whole thing Okay, we have those already pretty sure and okay channel selector the noise checkbox And can this be as separated going to separate lines Yes be just Yeah, it's okay Let it be a drop down a number of levels It should be in the java script There's another output tool And yeah the problem with this two Not a separate plot containers This one will have this two That there is a key Log is okay script js Is okay Google leads it's fine The entire set of input controls is wrapped within a less than form greater than This ensures that we can capture any changes made to the input fields and submit the form Which will send the updated parameters to the server Added new input controls for wavered denoise discrete wavered transform and levels are specified Placeholder less than div greater than elements for the snr and mse outputs are added The server will populate the appropriate values here when the form is submitted The java script at the bottom adds an event listener to each input element inside the form Whenever any inputs value changes change event the form gets automatically submitted form submit Which sends the updated parameters to the server and refreshes the page with new outputs Is this Analysis form Do I have to use it? So in the html Oh, why is it there? Yeah, don't Like it mainly because we're not currently doing this And do we have to Do Does this Have to Call a const What a frequency scale So that's fetching it by id is it? So it should be Yeah, that's new Then we have Wavered transform Levels And right Those two Placeholders Added correct names A little network errors to gpt4 Suspect just Kind of gives you clues what's gonna happen to this service I think it's so gonna go down have to wait and see And also not rely on it 100% So why can't I use the same? A Bunch Difference with A vs H.data and render it should be the same You give me like a generic generic stuff Let's update the current function that we already have Instead of adding a New one Now we don't have the form anymore remember Are we converting to json? Don't think so Oh, yeah Don't understand why aren't you updating the current code? Do we need to start a new chair to something? Yeah, let's do A new one So if we have this html Yes, stop generating Then we have this js Will it pick up on what needs to be fixed? The commented out code related to play button functionality and a play speed control If these features are intended to be implemented in the future the respective code can be uncommended and integrated Okay, now ignore Ignore Code related to play button Where's the It's need to be replaced by that with the actual parameters Can you focus on this one? We had it in the previous code and it's working fine. So I'm not sure what's the deal certainly Let's update the fetch data and update child function to fetch data using the appropriate parameters similar to the fetch data and render function Do we need fetch data Fetch and render Upon closer inspection both functions essentially perform the same action. They fetch data and then render it The distinction mainly seems to be the way they're triggered one by the scroller and other controls and the other by timer Yeah, we can just combine So this seemed to be quite Specific which is good And let's just create a copy of this quickly Just in case we stuff something up. Is this the complete thing? End point base That's right Channel selector window size the trend toggle Filter all the whole spectrum Frequency scale Wait Frequency Yeah, it's a bit weird Yeah, why is that? Second all right, that's using that variable this should be the same Fetch API URL response JSON and data Eh, we don't need logging there You plot new plot in the start start playback function Replace fetch update Once again Yeah, so we only use we want to Eh, only use the one function So that can be commented out A get touches 52 Yeah, the playback is actually not there And three starches to make sure everything's working Now that's working, okay Wait, let's clear this first. I click on so And it's not a JSON Eh, JavaScript 54 Let's pop the whole Everything in with the Here is see what it says This event listener input function Listener you're not accidentally passing the event object If you intended to pass a value from the event to fed data arena, you should extract it properly It's good practice to handle potential errors from the server in your fed call Lastly, since you're seeing a 500 internal server error, I recommend checking the server logs for more details about what went wrong The flash logs should give you more information about the course of the error Allowing you to diagnose and fix any issues with your server side code And it's clear this for sick The server side error traceback makes clear what the issue is The flash group get underscore data tries to get the start second parameter from the request and convert it to an integer using However, it's receiving object event as the value for start second Which is what we suspected from the client side error and obviously python can't convert the object event An integer resulting in a value error You need to ensure that start second is getting the correct value when forming the request url In the fetch data and render function when you construct the parameters make sure you're providing a valid integer value And this is the same Ensure that file scroller value is indeed an integer for a string representation of an integer and not an event object or some other non-integer value Also double check any other places where fetch data and render is being called to make sure that if an argument is passed Is the expected integer or null Also double check any other places where fetch data and render is being called to make sure that if an argument is passed Is the expected integer or null Yeah, we put in now It should interior start In the beginning of the file Yeah, I'm not having much luck Today We've regenerated last response The python trace back you've provided clarifies the issue your flask server is encountering a value error Where it attempts to convert the value of the start second parameter into an integer This error occurs because the start second parameter is being passed as object event, which is clearly not a valid integer This problem is arising from the javascript side of your code where the start second parameter is incorrectly being set The root course is in the way fetch data and render is called or how parameters are handled Fixing the javascript code ensure proper argument passing make sure that when you call fetch data and render you pass the correct argument for second It looks like you're passing the whole event object instead of a specific value from it Here's the event listener that might be causing the problem javascript copycode file scroller add event listener Invert function fetch data and render if fetch data and render is supposed to use a value from file scroller You need to pass this value explicitly For example if file scroller is an input element and you want to use its value It should be something like this javascript copycode file scroller add event listener input function cons second equals pass in file scroller value 10 fetch data and render second Adjust the logic according to what file scroller is and what value you need from it Debugging if you're still facing issues add console logs to debug For example javascript copycode function fetch data and render second equals null console dot log Fetch data and render call with second second Rest of your code this will help you to verify that the function is receiving the correct parameter Validate on flask side as an additional safeguard you might want to add validation on the flask side to handle any unexpected parameter values gracefully For example python copycode at app.root get underscore data def get underscore data try start underscore second equals end Request args dot get start second zero except value error start underscore second equals zero hash or handle this scenario as you see fit hash Rest of your function by ensuring that the correct value is passed from the javascript front end and adding some safeguards on the python back end You should be able to resolve this error Don't actually understand. Can you make it clearer? So what the problem is? Your flask back end is throwing an error because it's receiving the string object event instead of a valid integer for the start second parameter Okay What's the solution? Ensure that you're passing the correct value for the second parameter to fed data and render Does it have a second parameter? It's only has one parameter When you call fed data and render inside the file scroll event listener You're not passing any argument which results in the function receiving the event object itself as the second parameter Okay, I'm not passing Any parameter I mean I don't want to change the python code That's working. Okay I'm changing Okay, can I get rid of and all that do fix You've already implemented the recommended change in the javascript to address the issue of passing the event object Object event and the fed data and render function Specifically you updated the file scroll event listener to pass the scrollers value correctly However to ensure full robustness and avoid potential issues in the future. I'd recommend a few additional changes Well, first of all, I'm still getting errors and let's restart the application For a sec Should be so it's running. Okay the first time around The file scroller is working. Well The frequency spectrum is updating. Okay Now problem is those I do not expect those to work yet It won't be they're not actually connected. Anyway, let's say when changing the channel Number I get this error That's not cool So I'm getting a 500 response Hey, how do we fix it? I'm still Still getting Because we combine two functions together that weren't actually meant to be there The error message you're seeing suggests that somewhere in your javascript code An event object is being passed to the start second parameter to the fetch data and render function Given the provided code you correctly ensure that the event isn't being passed in your file scroller event listener Okay, so what's the problem is For all the event listeners that call fetch data and render pass an explicit value instead of relying on a default null or event object Right because so the problem would be with this Javascript This last call is it? Right, so I need to change All of those Add default parameter in fetch data and render Right or just end default. Okay Modify the fetch data and render function to handle null or any other unexpected values Uh, right, so we So this should Resolve any Yeah, we don't want to change the python code because I know It's been working Right. Well now it's working. Okay Yeah, so it's the default value for the fetch data and render function those Those are okay. It's trying to put in Google ads and things in the Non production code size working the trend Yeah, the trend just making sure the Signal is centered around the zero because sometimes Yeah, it's not making much change, but it is all working Yeah, this is overlaying the whole spectrum in production and it will look more like It will look a bit better like this As this is the previous tool we have over here And currently working on this one the genoise removal which will look the same But you'll have this extra wavelet denoise function Where you can select the script wavelet transform or undecimated And select the number of levels Right this needs to be updated as well Well, that's why it's not in production yet. This data has a seizure unit this e.g I think it's mainly coming from one side of the brain than the other Yeah, this will max out at 60 so i'm not even sure why the one does Tiny bits or so so you can manually it's actually quite surprising Can manually add Yes, this is the whole seizure And something is wrong No, so it's coming from Because we have eight channels on one side of the brain and eight channels on the other side of the brain So the seizure is actually starting I think it's the left zero to seven And then seven to fifteen Would be the right where the seizure essentially more visible later So it's what's it used to be called? secondary generalized where seizure is Starting locally and then spreading throughout the brain. Um, so when default if I restart the page to the the default values So this is the epi epi center Yes, I'm not joking. There was some A papers some attempts to compare seizures to A It's called the earthquakes And yes, it's a bit like an earthquake in the brain So in this case, uh comparing your baselines after seizure And the Delta to theta ratio could be handy Because currently it's about was it third? Enduring seizure in some places during seizure It's about uh one to one ratio almost so higher A frequency component A power in the higher frequency components That's not always always the case. So yeah, I have to be careful with these things. Anyway, and the Yeah, so this tool Is available on the page. You can go check it out. Let me know what you think what I can improve any questions suggestions comments requests A Stop doing this Is not A Accepted comment Right, let's get back To this because we're trying to a at the wavelet the denoising functions I think we kind of almost there If that Works How about About the new inputs Related to To Wavelet noise start from here. Let's see what the pod can to say To integrate the new inputs related to wavelet denoising into your javascript and the request to the flask back end You need to update both your javascript code and flask code Here's a step by step guide on how to do it Okay, that's great. So you understand the context First you need to extract the values from the new input elements and add them to the params object that gets passed to the flask back end right So in a fetch Data and render function We need to add extra parameters As such Right, we need a comma there Yeah, we don't want to be tripped over little things So we are event listeners Okay, we're adding more here in the python In your flask group the handles to get underscore data endpoint. You need to extract these new parameters from the request and process them accordingly Here's a sample update Yeah, don't like sample sample means it's not the whole code get data Not using the frequency scale y And why is this default thing too linear Default default value to be returned if the key can be looked up No, this actually should be GitHub co-pilot doing anything at all. Is it called log? I don't think so. I know it is called log Okay, so default should be log. This parameter is not actually being used. So Um, we need to add these three Process the data. Yeah, let's see some comments The exact implementation of how you use these parameters in the back end depends on your applications requirements and the wavelet denoising logic Use the extractive parameters related to wavelet denoising to process the data as required Yep, this could involve applying a wavelet transform denoising the data and then using the inverse wavelet transform to get the denoised data Sounds good. Okay. We're ready Installed Wait, what did we just? All right, no, that's okay Let's save that. What's the difference between um versus py wavelets Both py wt and py wavelets refer to the same library Right Py wavelets is the name of the project and py wt is the name of the python module you import when you're using a library in your code Um Okay So you made a mistake there I know Okay And I already have it installed pretty. Yeah. Well first, it's not Indicating an error. The error there is that it's not being used, but I'm pretty sure I have it installed already Here's a simple example of how you might use wavelet denoising in the context of your flask endpoint Okay, this is very basic. It's missing a lot of code This is a very basic implementation of wavelet denoising In practice, you might want to find you in the thresholding strategy consider other wavelet functions or incorporate additional denoising techniques Furthermore, the exact steps and parameters can vary based on the nature of the data and specific requirements of the denoising process If your application has specific requirements, sorry, if you're working with a specific type of data like EEG data You might need more specialized processing Right. Well, first of all, that's why we have the input parameters so you can change and play with it and see what difference does it make Uh Let's see This simple Example Is okay Make A input values From the html For being Used all So we have three of them wavelet denoising on and off A have an option between discrete And non-descript, undestimated And then number of levels Which Is The number of levels in the discrete wavelet analysis Yeah, we need more Um context for that In case we're integrating something Of course Let's integrate the inputs from the html form into the wavelet denoising process Yeah, that's what I just said. We have wavelet denoise wavelet denoise the checkbox to decide whether to use wavelet denoising or not And this one as well Wavelet transform or drop down or similar to select the wavelet type like db1 db2, etc Um Right, so this should have more input in it that would be nice actually to have Different types of wavelets Selected Levels and input to determine the level of decomposition And that sounds legit In the flask endpoint, we need to retrieve these values from the request and use them accordingly Okay, so we're really doing that Yeah, we don't have db1 In the html levels Can we add more options Okay, I like db1 db1 db2 Okay, maybe something else give us This one More wavelet types Yeah, give me some other ones In terms db1 db2 and so on refer to d'orbiti's wavelets In wavelet analysis, the d'orbiti's wavelets are a family of orthogonal wavelets characterized by a maximum number of vanishing moments for some given support In simpler terms, the wavelets have properties that make them useful for signal compression and noise reduction Yeah, how about our type of wavelets used for each Yeah, I know what the eg is. Yeah, more let Yeah, that sounds good Okay, so we have those db1 db2 should be enough As mentioned before, these wavelets are popular due to their compact support and orthogonality Depending on the number of vanishing moments, i.e. the number after db, they can capture different features in a signal This wavelet is particularly popular in time frequency analysis of eeg signals It offers a good balance between time and frequency localization making it suitable for analyzing oscillatory activities in a eeg Setting a mexican head. And that should be plenty One wavelet gets Fresh this page Where are the charts? Chaser One of three What's the problem? The error message uncourt type error cannot read properties of null reading and event listener Is a common javascript error that occurs when you try to access or manipulate an html element that doesn't exist or hasn't been rendered yet In the area you provided the issue is happening on line 103 of the file eeg js The error message indicates that you're trying to attach an event listener to an element that is currently null That's it now. That's a failure Yeah Stop the app For sick Let's start it again. Okay, it's not running yet. Now. It's running Check the element id Didn't change the animal element id Kind of some problem with the microphone. You know what happened better now Yeah, it changed added stuff to this Not a steal It's still playing up It's really wet My microphone's playing up Okay, is it better now? I have to check. What's up? I didn't know We quit. Okay, it's still playing up