This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def stft(x): | |
| f, t, spec = signal.stft(x.numpy(), fs=16000, nperseg=255, noverlap = 124, nfft=256) | |
| return tf.convert_to_tensor(np.abs(spec)) | |
| def get_spectrogram(waveform): | |
| # Padding for files with less than 16000 samples | |
| zero_padding = tf.zeros([16000] - tf.shape(waveform), dtype=tf.float32) | |
| # Concatenate audio with padding so that all audio clips will be of the | |
| # same length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // LED pattern | |
| parameter PAT_LETTERS = 2'b00; | |
| parameter PAT_CONWAY = 2'b01; | |
| parameter PAT_RAIN = 2'b10; | |
| reg [1:0] curr_patt; | |
| ... | |
| // assign buffer based on curent pattern | |
| wire [63:0] w_fb = (curr_patt == PAT_LETTERS) ? w_fb_lett : | |
| ((curr_patt == PAT_CONWAY) ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| always @ (posedge clk) | |
| begin | |
| if (!resetn) | |
| begin | |
| // reset counters | |
| refresh_counter <= 0; | |
| // initialise grid | |
| grid[0:7] <= 8'b01010101; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // handle state machine | |
| case (curr_state) | |
| sSTART: | |
| begin | |
| // start new frame | |
| curr_state <= sNEW_FRAME; | |
| end | |
| sNEW_FRAME: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| always @ (posedge clk) | |
| begin | |
| // initialise | |
| if (!resetn) | |
| begin | |
| pcounter <= 0; | |
| d88_counter <= 0; | |
| xp <= 0; | |
| yp <= 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################### | |
| # to_ipv6.py | |
| # | |
| # Author: electronut.in | |
| # | |
| # Description: | |
| # | |
| # Convert from ipv4 to ipv6 | |
| # eg: | |
| # |
NewerOlder