Nadav Posted August 4, 2014 Report Share Posted August 4, 2014 Hi all, I am using papilio one + megawing in order to learn VHDL and logic design, in my free time. My question is about chapter 16's challenges, I don't think I fully understand the theory in the third line on page 74: "If you connect the two high address bits on RAM to switches you can have four different waveforms, each with 256 samples per cycle, possibly allow you to generate Square, Saw, Ramp and Sine waves from one project." I want to add that I am familiar with signal processing but I don't understand the method here. In my code I am using 8bit ROM with 1024 samples. values are of a full cycle of sine wave (so the first and the last equals 128, but values are between 28 and 228). If I will connect the two high address bits to switches I will only sweep on a quarter of a cycle for each switches combination, how's that giving me a square? or a saw? I tried it, even though I did'nt understand it, but for all the switches configuration the signal sounds the same... I will appreciate some help here Thanks:) Link to comment Share on other sites More sharing options...
offroad Posted August 4, 2014 Report Share Posted August 4, 2014 I think the idea is that instead of using 10 bits for a 1024 sample waveform, you could instead have four different 256-sample waveforms, which you select with a switch.But you have to regenerate the waveforms for a 256 length and pack four of them into the 1024-length memory. BTW, if you're working accurately, the first and last sample should not be equal for a sinewave. It's a common mistake, you have one excess sample. Use (1:(n-1))/n*2*pi for the phase. Link to comment Share on other sites More sharing options...
Nadav Posted August 5, 2014 Author Report Share Posted August 5, 2014 Thanks offroad, so you are saying that in order to generate the signals requested(sin, square, saw, ramp) I should artificially create them and wrap them all in a 1024 rows ROM? I was hoping that signals should be a result of some DSP operation on the sine wave... Nadav Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.