hifiaudioquality
hifiaudioquality
The Blog for the Hopeful.
6 posts
Have you ever wondered how to achieve perfect audio quality? If you answered yes, then follow the path as I work my way into the world of Hi-Fi audio. Starting from the bottom, I will post everything along the way so follow along!
Don't wanna be here? Send us removal request.
hifiaudioquality · 8 years ago
Text
Shift Register Array (74HC595)
Tumblr media
Hi all! It has been a minute since I last posted something electrical in nature. So here it goes; an almost completely digital circuit to control 32 outputs via 4 outputs.
My goal in this project was to create an array of shift registers to control a couple 7-segment LED displays. Somewhere in the process of designing a device that would control 32 outputs, I found no solution that was simple. 
After some tiring research, I found a solution to my problems. Shift Registers.
Why?
Well. Because I felt I needed the practice. Between completing homework and studying for rigorous tests, I found that my spare-time was a little void of something electrical. So i took up the idea of playing with the infamous 7-segment display. I then said to myself;
“Why not create a multiple segment display?”
So the shift register is a device which is used literally everywhere. A quick read will tell you that this device is the basis for every large scale output device, devices like TVs use these devices to control output display output.
The beauty of this device is that once you get one working, the next step is to “daisy-chain” these devices together. The last output of the first register becomes the input for the second register. The last output of the second register becomes the third register’s input and so on until you become tired of looking at these devices.
By creating an array, the output pins was scaled from 8 to 32. Since the first register is the only receiving commands from the micro-controller, the only inputs to this device are the controls for the first register.
A Shift-What?
A shift register works off a single clock input and latch. When the shift register senses a rising clock edge while the latch is active, it simultaneously looks onto the Data In and ‘records’ this value to the first bit-register. Remember there are eight bit-registers in each shift register. 
On the next cycle of the clock signal the shift register will again record the value on the Data In pin. Before recording this value to the first register, the device shifts all values to the next register. Thus a shift-register is born.
At this point I completely understand if you are lost, only the true nerds care about devices like this. But no fear, there are plenty of resources to help one understand this device. Just type into YouTube, “Shift Register” and there is a character named Kevin Darrah who explains this device tenfold times better than I did.
Serial Commands?
I mentioned serial commands before and I need to clarify before I go any further. Since I am using Arduino IDE with a regular Arduino UNO, I will append the code as a link to this post.
But still, understanding the serial commands is key to how this device outputs everything. So we know that the device will push data into the device and along each register sequentially, but once we are done pushing the data in we need to make the device display the values at each output pin. To do so we set the Latch input pin to logic low, and BAM all of the output pins are set to whatever was clocked into the device.
It is important to note that once the device has latched, no new data may be pushed into the device. Even if you were to clock in data in the correct fashion, the latch pin prevents unwanted serial commands from reaching the device. This is used to control the output and prevent unwanted output “glitches”.
Tumblr media
What’s Extra?
Nothing is extra but a soft latch that can be used to turn off the whole display via one pin. No extra programming needed, as this can be wired directly to a switch or always on by connecting it straight to ground.
Now What?
I do not intend on making this into anything useful. I was simply practicing what I learned about this chip and how to correctly “daisy-chain” this device. It was initially intended for a RC Controller that would give feedback via a RF transceiver. More on that to come later...
“Remember that there is nothing you can’t do. It only takes patience and practice.”  - Tanner H.
EDIT: Please hold until I get my computer back with the eagle files on it. I will then post the links here.
0 notes
hifiaudioquality · 8 years ago
Text
Stock Market API Calls/Analysis
Tumblr media
Hello there, 
It has been a minute since I have posted last but here is what I am working on....
“I need your mathematical/analytical skills to assist me in stock trading.”
That’s right, my friend was looking up charts while on a call with me and the request came in. I said, “Challenge Accepted” as Barney would in How I Met Your Mother.
I don’t know much.
But what I can do, is apply some advanced mathematical operators on the charts to identify significant change. I only assume this could be helpful in some way or another. 
Laplace Operation
I chose to try my luck with the Laplace operator because it detects a change in price or whatever value I want to test. In this case, a price for each stock was received with certain dates. In order to get the data I had to learn a bit about API calls to MarketOnDemand.
Programming Language
For now I will be using Octave because I do not like MATLAB’s exclusivity, although I know there is a way to everything similarly in MATLAB. I first created a function that grabs market data from the past 260 days and plots it on a graph. Only a vague company name can be used in most cases. For example:
>>stock_Lookup_Chart(’Apple’);
>>stock_Lookup_Chart(’AAPL’);
The above two are both correct as the API response will feedback the closest match.
Creating the encoded URL
In order to call on the API, one must compile a JSON parsed string encoded in URL format. To do such tasks, the following libraries were used:
JSONlab
urlencoding <- created to convert to URL format
remove_extras <- created to remove all extra characters in the string
I created the latter two because I wanted a more clean solution to do such task. I had a HUGE ISSUE trying to get the savejson() function to work properly because the API call parser would NOT take my input forever!
But alas, we don’t give up... I created a function to take out all of the unnecessary things. Once it removed all tabs(\t) and newlines(\n) it then encodes it into URL compatible format with the urlencoding() function.
Parsing The Data
Unlike the savejson() function, loadjson() function actually works quite well. It is easy to navigate through the structures in Octave. You just simply have to use the fieldnames() function, and anything else needed to sort through the data. For this case, I only needed dates and values. 
The Laplace Function
The basic but very effective Laplace operator goes something like:
Tumblr media
For all intensive purposes, this equation works fine to deal with 1D arrays.
The Laplace Transform
list_Laplace()
To see exactly what the Laplace transform does, here is a rectangular pulse that goes high halfway through and turns off quickly. The Laplace transform detects this change in spikes as shown below:
Tumblr media
As you can see, where the graph rapidly changes, the spike is created. This results as the data is being analyzed, it first comes up to the change and will record a larger value at the change. Once the value is past the spike, the value will see less after the change. This leads to the negative spike after the positive.
The plot_threshold function
Th plot_threshold() function was created to plot the data with color indication to see where the data changed related to the intensity in red. The following is what the plot_threshold() function does:
Tumblr media
The plot_threshold() function is simply a plot() function that has an additional parameter for the color track. The color track is automatically adjusted to the max value in color track as the darkest red and everything else in between.
For example
The following figure displays the function we want to plot, then the color_track and finally the result. 
Tumblr media
Let me download this and try it for myself in Octave!
All together, this program was very fun to create and I hope you have fun too. When you download the zip, it should have everything you need. To use it:
Change directories until you are in the folder where you unzipped everything. 
Use the stock_Lookup_Chart(’input_string’), where the input string is either a market Symbol or stock name. (i.e. AAPL, GOOGL, WMRT, etc.)
The data that is shown is the final result, only showing major changes in the first and second Laplace transform function which will get rid of lesser changes and make the larger changes more prominent.
Please feel free to email me with questions: [email protected]. I am attaching everything here for you to follow along.
Download all files needed here.
Cheers!
0 notes
hifiaudioquality · 8 years ago
Photo
Tumblr media
Joystick Potentiometer Breakout Boards
I made these because I will soon be creating a rc boat, fully equipped with two joysticks and triggers and 4 7 segment displays on the Remote Controller. More to come with this project...
How I Do It
I make these circuits at home on eagleCAD with my own unique design. I then print these onto photo paper and laminate a Copper cladded pcb with an iron. I then dissolve the Copper with a chemical solution that corrodes the Copper but not the ink toner. After a while I pull the boards out of the solution and into water. I then use acetone to wipe off the ink toner.
“It works but not the most professional looking.”
The one thing I could upgrade to this board would be the quality, as the Copper PCB was not as high of a quality as I’d like. This results in an uneven coat on the Copper. Since the ink does not transfer well, the results is very jagged edges and messy design.
How much does this cost?
It’s actually quite easy to start doing this, the only catch is that you have to print onto a photo paper with a Laser Printer.The total cost would be be somewhere around my total below:
Copper Clad PCB Board - $11.96
PCB Etching Solution - $14.49
Photo Paper 4″x6″ - $6.64
Thumbstick Potentiometer - $2.50
Of course if you already have etching resources, then this project would only be the cost of the thumbstick potentiometers + shipping.
The file below is the eagleCAD for this board.
eagleCAD Thumbstick_Breakout_Board.xcf
Tumblr media Tumblr media
0 notes
hifiaudioquality · 8 years ago
Video
tumblr
Hi all,
It has been a while since I have posted anything to my blog. I figured I would start adding things in preparation of trying to find a Summer internship. I will begin by posting a fairly old project, but I will be going into detail of how I accomplished such task.
The Start
One late night my friends were over and one was particularly intoxicated. To make matters more interesting, he was upset about a recent break-up with his girlfriend. This lead to a series of unfortunate events, one event in particular was the happening of him punching a hole through my cheap cardboard-like apartment door.
“I wish I had a picture of the damage, but he had a weak punch.”
The Beginning of the Custom Door
I started by first making sure my semi-conscious friend was OK and then I continued to hassle a free door out of him. The next week he arrived with a fresh door that fit in the doorway to replace the door which had previously been beaten by his fists.
I then thought to myself, “why waste a perfectly normal door with a minor amount of damage?”
So then came the brainstorming... I though of various ways to manipulate this door to my liking. I thought maybe I could try to turn it into a one-way mirror... No, too creepy. Maybe I could throw a TV on it.... No, that’s useless.
Then I thought, “wouldn’t it be cool to turn it into something that would react to someone’s knock?”
I eventually decided upon using my University’s logo onto it and then cutting out the lettering for the school and the mascot’s eye and placing 5mm LEDs behind it.
Designing Challenge
I then thought of how I would fit LEDs to the back of this door while not making a huge mess. Well to my suprise, the door is basically two sheets of veneer or cardboard separated by IKEA-like corrogated cardboard. The image below is exactly like the one I used below but is only for reference.
Tumblr media
So i thought of a way to use the door to it’s potential. It includes using a cutout of one layer of cardboard, flipping it over and mounting everything to the flipped piece of cardboard.
Once I had cutout the back of the door, I had a large working canvas. I then drew the logo on the front of the door and painted over it with cheap paint. I wasn’t too careful as I am by no mean an artist. I then sprayed over the logo and door with a lacquer satin finish. 
The circuit
The knock sensor is a simple piezoelectric transducer, wired in parallel with a 1 Mega-Ohm resistor, in parallel with a 5v Zener Diode. The output of this was fed into a microcontroller. I used a ATTiny2313 for this project although I could have easily gotten away with much less pins. I only used 4 pins in this project. 1 input and 3 outputs. Each output is connected to a NPN transistor which is tied to each RGB LED’s cathode. Each LED is wired in parallel on the back of the one piece of cardboard. I have included the project time-lapse of the wiring of the door.
youtube
The Dark Side
The back of this door is truly ugly and quite hideous. Oh well, hindsight is always 20-20. If I were to do this project again, I would definitely chose to implement LED strips to make my life easier. I would also use a custom PCB that would fit snug inside of the door.
Tumblr media
The Coding
When I initally wrote the code in the Arduino IDE, the digitalWrite() function takes up too much memory. Especially when dealing with the ATTiny2313 which only has 2kB of memory. This made everything a challenge in terms of coding, unfortunately I don’t have the computer I programmed this with anymore. 
I will give you a hint as to how this works though. 
The code contains three variables for each color RGB. When the door has sensed a knock, it chooses at random a color to be set all the way high. It then decreases the intensity of each color as each couple milliseconds passes by. It continues to do this until each color is at it’s lowest setting of zero. This means the colors can overlap while someone is knocking-on the door. This makes for a brilliant color display when continuously knocking on the door, almost as if it were a firework display on the door.
Conclusion
I hope you liked my project as much as I did, feel free to contact me with any questions or concerns. I am not the best and I know that. I am just making my way towards becoming an electrical engineer and any help along the way is appreciated. Thanks for reading/watching!
Have a nice day!
0 notes
hifiaudioquality · 11 years ago
Photo
Tumblr media Tumblr media
Here it is all painted and looking sharp. About to apply a polycrylic coat to wear and tear proof it! I got the crossovers made and assembled. Cumulative hours put into this speaker so far: 15
0 notes
hifiaudioquality · 11 years ago
Photo
Tumblr media
Hey all!
This is my first post but please stay tuned to hear what I have to tell you all…
Before I go into extreme detail, I must say the speaker enclosure is not complete. The stage that I am in, I am calling it “limbo” because I am waiting for certain parts to arrive which are on back-order. 
From the Beginning
Yes. From the beginning I have doubted the sound quality of this gargantuan piece of “Hi-Fidelity” audio equipment. You see, my original intention was to make this speaker box from a different material. Instead I went with a cheaper wood and I made the size around twice the depth I originally intended as well. I find it funny because every time I explain my project to close friends and family they all give me the same reaction.
   "Oh it looks awesome, I can’t wait to hear it!"
This is what has lead me to say “from the beginning.”
Materials
When I started this project, I had one thing in mind. Hi-Fi. I was thinking I could make the SPL completely steady down to about 75 Hz - something scientists would kill for. I also had one other thing on my mind, money. Not to say anything bad about my situation but I don’t have the best of funds to play with, so instead of going with my original design of MDF, I settled for Particle Board. And if you can make an educated guess, Particle Board is not as great as MDF for audio projects. It flakes here and there and chucks of wood come out during the cutting stage and now there are holes maybe a quarter inch deep filled with wood putty. So here I am starting the project already saying, “from the beginning.” But it doesn’t end here. No, in fact when cutting this ‘magnificent’ box. I had everything laid out and neatly displayed and I took a small fifteen minute break and came back to dry fit the speaker box. When I assembled everything I noticed a gap about the thickness of the wood. So I continued to cut off the error. When I dry-fit the box the next time, I noticed an overlap of about the thickness of the wood. I don’t know if you’ve ever heard the saying:
  “Measure twice and cut once.”
But I sure have, and I’d done messed up. This happened because as I was dry-fitting the first time I had the two sides flush with the bottom when they were not to be and the bottom piece rotated 90 degrees the wrong way. With the bottom piece rotated 90 degrees the wrong way the dimensions were perfectly flush on the sides just by complete luck. 
Originally I had the pieces perfect but when I saw that there was a gap in the box, I forgot to measure twice before taking my anxious mind to the saw and cutting little by little off.
All in all after the mis-measure it cost me 1 1/8” of wood off the height of the box. This brings down the dimensions down from the original. H 32” x W 16” x D 8” to a staggering H 30 7/8” x W 16” x D 15 1/2”.
If you read that, you might be confused as to why the depth was increased so dramatically but quite honestly I am too. I don’t really recall the exact reasoning of that choice, but I’m sure somewhere along the way it just “felt right” when I was cutting it. Oh if you could see the look of anger I had once I measured after the box was glued and gunned. There is not a nice and neat box in my garage, there is a giant - maybe even a little fat - speaker enclosure sitting on its fat bottom.
Here I am from the beginning. Doing it all wrong. Now ask yourself, “Is this system going to be asvHi-Fi I would like it to be?” You could either fumble around with a couple nice words in your head or you could just say what really needs to be said. No.
Regret and Remorse
There is nothing like a nicely well done job! And some may say you have too many adjectives, but I say whatever because I have seen Hi-Fi audio equipment. I have seen the speakers my dad kept through all of college and all of his adulthood. I have felt the sound that cost upwards to $5,000 dollars each. And you know what? Not never! Never in their entire build of those speakers did they once say,"whatever."
Not once did they just measure once. Not once did they take a fifteen minute break and come back only to say the w-word and cut off a whole inch and some change!
So even before did I hear any sound from this box I know I had failed in my own intentions and here I work on a broken dream. The more and more people tell me how nice it looks or how they cannot wait to hear it, I grow disappointed in myself. I am so disappointed, I am to the point of being embarrassed of it. 
Recuperation
After a few days and nights of reflection, new light has been shed. By this I mean the components arrived. Each night I sit down arranging the pieces trying to make sure the crossover is exceptional. I am no Nikolai Tesla, but I dabble in the arts of electronics once in a while. The problem isn’t in the general concept of a crossover, it’s in a series crossover.
I am dealing with an amplifier which doesn’t take a low impedance very well and likes to cut-out when the bass hits. So in order to counter-act the cheap amplifier I have decided to work in a series crossover instead of a parallel crossover. But saying is easier than doing.
Currently
Currently I work with my friend who will paint the speaker enclosure and I work alone each night to get the crossover perfect. Working on the crossover brings me hope. It brings me hope to try the theory of crossover because hopefully when I am done with this project the bit of wood that I rejected and the type of wood I switched to won’t matter. All because the crossover picked up the slack of the creator, Me.
To those who read this, you have my word.
   "I pledge to make this the best speaker I can make it, and I will stop at nothing. I will put in the extra time to make sure this speaker never fails to provide a smile or a slightly less experience than jaw-dropping."
And until next time, peace.
0 notes